Thijs Lubberman
/
Minor_test_serial
Exercise 2c
Fork of Minor_test_serial by
Revision 2:058bdf721027, committed 2018-09-11
- Comitter:
- thijslubberman
- Date:
- Tue Sep 11 13:47:54 2018 +0000
- Parent:
- 1:40470bc517f1
- Commit message:
- Code now prints input to screen
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Sep 11 10:42:39 2017 +0000 +++ b/main.cpp Tue Sep 11 13:47:54 2018 +0000 @@ -7,12 +7,14 @@ int main() { int i = 0; + char c; pc.baud(115200); pc.printf("Hello World!\r\n"); while (true) { wait(0.5f); // wait a small period of time - pc.printf("%d \r\n", i); // print the value of variable i + c = pc.getc(); + pc.printf("%c \r\n", c); // print the value of variable i i++; // increment the variable myled = !myled; // toggle a led }