mark van Holland
/
Minor_test_serial
42
Fork of Minor_test_serial by
Revision 1:940e13e7ef32, committed 2016-09-12
- Comitter:
- markvh5
- Date:
- Mon Sep 12 09:36:35 2016 +0000
- Parent:
- 0:c8f15874531b
- Commit message:
- press key for LIGHT
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c8f15874531b -r 940e13e7ef32 main.cpp --- a/main.cpp Wed Sep 02 14:50:46 2015 +0000 +++ b/main.cpp Mon Sep 12 09:36:35 2016 +0000 @@ -6,14 +6,16 @@ int main() { - int i = 0; + char c; pc.baud(115200); pc.printf("Hello World!\n"); while (true) { - wait(0.5f); // wait a small period of time - pc.printf("%d \n", i); // print the value of variable i - i++; // increment the variable - myled = !myled; // toggle a led + c = pc.getc(); + if (c != NULL) + { + pc.putc(c); + myled = !myled; // toggle a led + } } }