Lisanne Sevat
/
Minor_test_serial
Practice 1 assignment 2 test
Fork of Minor_test_serial by
Revision 1:7b5dd63e68eb, committed 2016-09-12
- Comitter:
- LisanneS
- Date:
- Mon Sep 12 10:07:25 2016 +0000
- Parent:
- 0:c8f15874531b
- Commit message:
- Practice1
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 02 14:50:46 2015 +0000 +++ b/main.cpp Mon Sep 12 10:07:25 2016 +0000 @@ -3,16 +3,17 @@ DigitalOut myled(LED_GREEN); MODSERIAL pc(USBTX, USBRX); +DigitalIn btn(SW2); int main() { int i = 0; pc.baud(115200); - pc.printf("Hello World!\n"); + pc.printf("Hello World!\n\r"); while (true) { wait(0.5f); // wait a small period of time - pc.printf("%d \n", i); // print the value of variable i + pc.printf("%d \n\r", i); // print the value of variable i i++; // increment the variable myled = !myled; // toggle a led }