From 1c1b3c8d74b1bff02bffbec91bcdc96fce61a82e Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sat, 12 Jan 2013 09:38:38 +0100 Subject: TDISP: added custom character routine --- demos/modules/tdisp/main.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'demos') diff --git a/demos/modules/tdisp/main.c b/demos/modules/tdisp/main.c index b67b3b8c..4ee53c99 100644 --- a/demos/modules/tdisp/main.c +++ b/demos/modules/tdisp/main.c @@ -28,9 +28,11 @@ int main(void) { tdispInit(); + /* reset cursor position and clear the screen */ tdispHome(); tdispClear(); + /* set cursor position and draw single characters */ tdispGotoXY(4, 0); tdispDrawChar('H'); tdispDrawChar('D'); @@ -40,8 +42,22 @@ int main(void) { tdispDrawChar('8'); tdispDrawChar('0'); + /* draw a string to a given location */ tdispDrawStringLocation(0, 1, "chibios-gfx.com"); + /* create and display a custom made character */ + charmap[0] = 0b00000; + charmap[1] = 0b00100; + charmap[2] = 0b00010; + charmap[3] = 0b11111; + charmap[4] = 0b00010; + charmap[5] = 0b00100; + charmap[6] = 0b00000; + charmap[7] = 0b00000; + tdispCreateChar(0, charmap); + tdispHome(); + tdispDrawChar(0); + while(TRUE) { chThdSleepMilliseconds(250); } -- cgit v1.2.3