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 
19 #ifndef MICROBIT_H
20 #define MICROBIT_H
21 
22 #include <stdint.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 #define MICROBIT_MATRIX_ROWS (5U)
32 
36 #define MICROBIT_MATRIX_COLS (5U)
37 
41 void microbit_matrix_init(void);
42 
49 void microbit_matrix_on(uint8_t row, uint8_t col);
50 
57 void microbit_matrix_off(uint8_t row, uint8_t col);
58 
68 void microbit_matrix_set_raw(const uint8_t *buf);
69 
75 void microbit_matrix_set_char(char c);
76 
83 void microbit_matrix_shift_str(const char *str, uint32_t delay);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* MICROBIT_H */
90 
microbit_matrix_shift_str
void microbit_matrix_shift_str(const char *str, uint32_t delay)
Shift the given string through the LED matrix.
microbit_matrix_init
void microbit_matrix_init(void)
Initialize the micro:bit's LED matrix.
microbit_matrix_on
void microbit_matrix_on(uint8_t row, uint8_t col)
Turn on a single LED in the LED matrix.
microbit_matrix_set_raw
void microbit_matrix_set_raw(const uint8_t *buf)
Write the given 'image' to the LED matrix.
microbit_matrix_off
void microbit_matrix_off(uint8_t row, uint8_t col)
Turn off a single LED in the LED matrix.
microbit_matrix_set_char
void microbit_matrix_set_char(char c)
Write the given character to the matrix, using the Mineplex font.
delay
void delay(unsigned long msec)
Sleep for a given amount of time [milliseconds].