microbit.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2016 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
28 #define MICROBIT_MATRIX_ROWS (5U)
29 
33 #define MICROBIT_MATRIX_COLS (5U)
34 
39 
46 void microbit_matrix_on(uint8_t row, uint8_t col);
47 
54 void microbit_matrix_off(uint8_t row, uint8_t col);
55 
65 void microbit_matrix_set_raw(const uint8_t *buf);
66 
73 
80 void microbit_matrix_shift_str(const char *str, uint32_t delay);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
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].