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

Committer:
DaniusKalv
Date:
Wed Jul 30 10:28:47 2014 +0000
Revision:
5:76dd6da3e640
Parent:
4:de56a118e704
Child:
6:76b89d8b62a0
Added bluetooth

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DaniusKalv 0:06ac39308380 1 #include "mbed.h"
DaniusKalv 0:06ac39308380 2 #include "matrix.h"
DaniusKalv 2:3cc1e2dec7a2 3 #include "text.h"
DaniusKalv 3:35a47548d29d 4 #include "rtos.h"
DaniusKalv 2:3cc1e2dec7a2 5
DaniusKalv 2:3cc1e2dec7a2 6 text generator;
DaniusKalv 3:35a47548d29d 7 matrix display(p13, p12, p11, p14, p15, p17, p16);
DaniusKalv 5:76dd6da3e640 8 Serial pc(USBTX, USBRX);
DaniusKalv 5:76dd6da3e640 9 Serial bluetooth(p28,p27);
DaniusKalv 5:76dd6da3e640 10 char line[256];
DaniusKalv 0:06ac39308380 11
DaniusKalv 0:06ac39308380 12 int main() {
DaniusKalv 5:76dd6da3e640 13 bluetooth.baud(38400);
DaniusKalv 5:76dd6da3e640 14 generator.generate("LIAULIUS");
DaniusKalv 5:76dd6da3e640 15 while(true){
DaniusKalv 5:76dd6da3e640 16 if (bluetooth.readable()){
DaniusKalv 5:76dd6da3e640 17 bluetooth.gets(line, 10);
DaniusKalv 5:76dd6da3e640 18 pc.printf("\r\n%s", line);
DaniusKalv 5:76dd6da3e640 19 generator.generate(line);
DaniusKalv 5:76dd6da3e640 20 }
DaniusKalv 3:35a47548d29d 21 display.show();
DaniusKalv 5:76dd6da3e640 22 }
DaniusKalv 2:3cc1e2dec7a2 23 //matrix("WELCOME!");
DaniusKalv 0:06ac39308380 24 }