Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Minor_test_serial by
Diff: main.cpp
- Revision:
- 2:794c87b4a13a
- Parent:
- 1:40470bc517f1
- Child:
- 3:2a93e9b6b42a
--- a/main.cpp Mon Sep 11 10:42:39 2017 +0000
+++ b/main.cpp Wed Sep 12 11:07:49 2018 +0000
@@ -6,14 +6,16 @@
int main()
{
- int i = 0;
+ char c;
pc.baud(115200);
pc.printf("Hello World!\r\n");
-
+ myled = 1;
while (true) {
+ c = pc.getc();
+ pc.printf("%c \r\n", c); // print the value of variable i
+ myled = !myled; // toggle a led
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
myled = !myled; // toggle a led
+
}
}
