Serial Communication
Dependencies: mbed
Fork of Nucleo_serial_menu by
Diff: main.cpp
- Revision:
- 3:8134f6d1ca47
- Parent:
- 2:87127bdc7e93
- Child:
- 4:fde2463b2846
diff -r 87127bdc7e93 -r 8134f6d1ca47 main.cpp --- a/main.cpp Wed Oct 12 07:07:02 2016 +0000 +++ b/main.cpp Wed Oct 12 07:32:52 2016 +0000 @@ -18,10 +18,12 @@ uint8_t data; myled = 0; - pc.printf("Hello World !\n"); + pc.printf("Hello World !\n\n"); while(1) { if(state_show == 0) { - pc.printf("Menu\n"); + pc.printf("************\n"); + pc.printf(" Menu \n"); + pc.printf("************\n"); pc.printf("1.LED Test\n"); pc.printf("2.Print Test\n"); state_show =1; @@ -74,16 +76,16 @@ } while(state_exit ==0); - pc.printf("\n\n"); + pc.printf("\n"); break; case '2': do { if(state_menu == 0) { - pc.printf("LED Test\n"); - pc.printf("a.Menu 2 TEST\n"); - pc.printf("s.Run\n"); + pc.printf("Print Test\n"); + pc.printf("a.Print -Hello-\n"); + pc.printf("s.Print -Bye Bye-\n"); pc.printf("x.Exit\n"); state_menu = 1; } @@ -95,12 +97,12 @@ switch(data) { case 'a': - pc.printf("Menu 2 TEST\n"); + pc.printf("--> Hello <-- \n\n"); break; case 's': - pc.printf("Run\n"); + pc.printf("--> Bye Bye <-- \n\n"); break; @@ -112,16 +114,13 @@ default: pc.printf("plz select a or s\n"); - pc.printf("\n\n"); + pc.printf("\n"); break; } } - - - } while(state_exit ==0); - pc.printf("\n\n"); + pc.printf("\n"); break; @@ -131,7 +130,7 @@ default: pc.printf("plz select 1 or 2 only\n"); - pc.printf("\n\n"); + pc.printf("\n"); break; } }