Loading...
Searching...
No Matches
microbit.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
21
22#include <stdint.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31#define MICROBIT_MATRIX_ROWS (5U)
32
36#define MICROBIT_MATRIX_COLS (5U)
37
42
49void microbit_matrix_on(uint8_t row, uint8_t col);
50
57void microbit_matrix_off(uint8_t row, uint8_t col);
58
68void microbit_matrix_set_raw(const uint8_t *buf);
69
76
83void microbit_matrix_shift_str(const char *str, uint32_t delay);
84
85#ifdef __cplusplus
86}
87#endif
88
void microbit_matrix_set_raw(const uint8_t *buf)
Write the given 'image' to the LED matrix.
void microbit_matrix_set_char(char c)
Write the given character to the matrix, using the Mineplex font.
void microbit_matrix_init(void)
Initialize the micro:bit's LED matrix.
void microbit_matrix_shift_str(const char *str, uint32_t delay)
Shift the given string through the LED matrix.
void microbit_matrix_on(uint8_t row, uint8_t col)
Turn on a single LED in the LED matrix.
void microbit_matrix_off(uint8_t row, uint8_t col)
Turn off a single LED in the LED matrix.
void delay(unsigned long msec)
Sleep for a given amount of time [milliseconds].