aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2013-01-12 09:38:38 +0100
committerJoel Bodenmann <joel@unormal.org>2013-01-12 09:38:38 +0100
commit1c1b3c8d74b1bff02bffbec91bcdc96fce61a82e (patch)
treec18fe1827cb4fcc3823f01a2f995e08b39f485a6 /demos
parentff8e8c47d9c51c54995d2b0169d4b6d2edebdb3f (diff)
downloaduGFX-1c1b3c8d74b1bff02bffbec91bcdc96fce61a82e.tar.gz
uGFX-1c1b3c8d74b1bff02bffbec91bcdc96fce61a82e.tar.bz2
uGFX-1c1b3c8d74b1bff02bffbec91bcdc96fce61a82e.zip
TDISP: added custom character routine
Diffstat (limited to 'demos')
-rw-r--r--demos/modules/tdisp/main.c16
1 files changed, 16 insertions, 0 deletions
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);
}