Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- DaniusKalv
- Date:
- 2014-10-30
- Revision:
- 6:76b89d8b62a0
- Parent:
- 5:76dd6da3e640
- Child:
- 7:ca5ed7936472
File content as of revision 6:76b89d8b62a0:
#include "mbed.h" #include "matrix.h" #include "text.h" #include <string> text generator; matrix display(p13, p12, p11, p14, p15, p17, p16); DigitalOut led(LED1); Serial pc(USBTX, USBRX); Serial bluetooth(p28,p27); char line[256]; void receive(); int main() { pc.baud(115200); bluetooth.baud(38400); bluetooth.attach(&receive, Serial::RxIrq); generator.generate("HELLO WORLD SAYS LED MATRIX"); while(true){ if (strlen(line) > 0){ led = 0; generator.generate(line); memset(line, 0, sizeof(line)); } display.show(); } } void receive(){ led = 1; int i, j = 0; i = 10 * (bluetooth.getc() - 48); i += bluetooth.getc() - 48; do{ line[j] = bluetooth.getc(); j++; wait(0.0004); } while(bluetooth.readable() && (j < i)); }