![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test
Fork of Minor_test_serial by
Diff: main.cpp
- Revision:
- 2:43637941ea73
- Parent:
- 1:40470bc517f1
- Child:
- 3:d8ad579c9fef
--- a/main.cpp Mon Sep 11 10:42:39 2017 +0000 +++ b/main.cpp Mon Sep 17 19:21:46 2018 +0000 @@ -6,14 +6,17 @@ int main() { - int i = 0; - pc.baud(115200); + + pc.baud(115200); //setup of bits per second 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 - i++; // increment the variable + if(pc.readable()){ // returns 1 if there is a byte available, 0 if not + char c; // create character + c = pc.getc(); // character comes from input pc + pc.putc(c); // print input character on screen + //pc.printf("\n"); //print enter after character myled = !myled; // toggle a led + } } }