Di Chan
/
SerialAOS
Serial mbed
Fork of Serial_HelloWorld_Mbed by
Revision 2:7d1b18bdfdeb, committed 2015-02-23
- Comitter:
- dii168
- Date:
- Mon Feb 23 13:31:40 2015 +0000
- Parent:
- 1:560b8ced44df
- Commit message:
- This is the Serial Program for the mbed
Changed in this revision
C12832.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Mon Feb 23 13:31:40 2015 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/chris/code/C12832/#7de323fa46fe
--- a/main.cpp Sun Sep 21 05:44:05 2014 +0000 +++ b/main.cpp Mon Feb 23 13:31:40 2015 +0000 @@ -1,10 +1,20 @@ #include "mbed.h" - -Serial pc(USBTX, USBRX); // tx, rx +#include "C12832.h" + +C12832 lcd(p5, p7, p6, p8, p11); +Serial pc(USBTX, USBRX); -int main() { - pc.printf("Hello World!\n\r"); - while(1) { - pc.putc(pc.getc() + 1); // echo input back to terminal - } +int main() +{ + char buffer[128]; // + while(1) + { + pc.gets(buffer, 2); // Take the value in buffer and put in Serial + + pc.printf("I got '%s'\n", buffer); // Displays stuff + lcd.locate(0,0); + lcd.cls(); + lcd.printf(buffer); + } + } \ No newline at end of file