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:
- 22:8a5ea75ad53b
- Parent:
- 20:8055a5b5dba0
--- a/main.cpp Mon Nov 24 17:52:09 2014 +0000 +++ b/main.cpp Sat Oct 03 17:11:30 2015 +0000 @@ -20,7 +20,7 @@ char buffer[4]; bool dot; pc.baud(115200); - bluetooth.baud(38400); + bluetooth.baud(115200); void (*foo)() = &receive; bluetooth.attach(foo, Serial::RxIrq); generator.generate("Hello world!"); @@ -64,7 +64,7 @@ do{ line_buffer[j] = bluetooth.getc(); j++; - wait(0.0004); + wait(0.0001); } while(bluetooth.readable() && (j < i) && (j < 99)); } @@ -72,7 +72,7 @@ mode_buffer = true; for (int i = 0; i < 10; i++){ line_buffer[i] = bluetooth.getc(); - wait(0.0004); + wait(0.0001); } realTime = atoi(line_buffer); set_time(realTime);