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 
20 #ifndef MICROBIT_H
21 #define MICROBIT_H
22 
23 #include <stdint.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #define MICROBIT_MATRIX_ROWS (5U)
33 
37 #define MICROBIT_MATRIX_COLS (5U)
38 
43 
50 void microbit_matrix_on(uint8_t row, uint8_t col);
51 
58 void microbit_matrix_off(uint8_t row, uint8_t col);
59 
69 void microbit_matrix_set_raw(const uint8_t *buf);
70 
77 
84 void microbit_matrix_shift_str(const char *str, uint32_t delay);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* MICROBIT_H */
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].