Syed Shakeeb Sadiq
/
mbed_serial_display
4D display with Gecko board
Diff: main.cpp
- Revision:
- 0:2bf48f170d3e
diff -r 000000000000 -r 2bf48f170d3e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 29 11:53:24 2016 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); +Serial screen(PB9,PB10); + +DigitalOut pc_activity(LED1); +DigitalOut screen_activity(LED2); + +int main(void) { + screen.baud(9600); + pc.printf("Hello World!\n\r"); + + while(1) + { + if(screen.readable()) { + pc.putc(screen.getc()); + screen_activity = !screen_activity; + } + + if(pc.readable()) { +/* + screen.putc(0x01); + screen.putc(0x06); + screen.putc(0x01); + screen.putc(0x00); + screen.putc(0x01); + screen.putc(0x1A); +*/ + screen.putc(pc.getc()); + pc_activity = !pc_activity; + } + + } +} \ No newline at end of file