Blue LED matrix (8x16) program. Gets text string through bluetooth and displays it on led matrix. Also has a clock function- get system time from a phone through bluetooth and enters clock mode. In clock mode it acts as a clock showing hours and minutes and blinking led every second. Clock mode can be broken if a text string is received through bluetooth.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 20:8055a5b5dba0
- Parent:
- 19:2b14139fb19f
- Child:
- 22:8a5ea75ad53b
--- a/main.cpp Wed Nov 19 09:19:28 2014 +0000 +++ b/main.cpp Mon Nov 24 15:02:37 2014 +0000 @@ -50,6 +50,7 @@ display.clock(buffer, dot); } else if (interrupt_flag == 0) display.show(); + //wait(0.1); } } @@ -58,10 +59,14 @@ int i, j = 0; i = 10 * (bluetooth.getc() - 48); i += bluetooth.getc() - 48; - do{ - line[j] = bluetooth.getc(); - j++; - wait(0.0004); + if(i > 0){ + mode_buffer = false; + do{ + line_buffer[j] = bluetooth.getc(); + j++; + wait(0.0004); + } + while(bluetooth.readable() && (j < i) && (j < 99)); } else{ mode_buffer = true;