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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:0422677b0ccc
- Parent:
- 0:408ece0a3217
- Child:
- 2:e9a626e1b717
--- a/main.cpp Tue Oct 20 05:08:51 2015 +0000 +++ b/main.cpp Tue Oct 20 07:29:25 2015 +0000 @@ -15,145 +15,36 @@ int main() { - int Menu_0 = 0; - int Menu_1 = 0; - int Menu_2 = 0; - int select_0 = 0; - int select_1 = 0; - int select_2 = 0; - int min = 2.5; + uint8_t menu_0=0; + uint8_t select_0=0; - pc.printf("Hello sir \n"); - + pc.printf("Hello Sir !!\n"); while(1) { - if(Menu_0 == 0) + if(menu_0 == 0) { - pc.printf("Select Menu \n"); - pc.printf("Input 1 for Menu1 \n"); - pc.printf("Input 2 for Menu2 \n"); - Menu_0 = 1; + pc.printf("Plese select your menu\n"); + pc.printf("Input 1 for Menu1\n"); + pc.printf("Input 2 for Menu2\n"); + menu_0 = 1; } - if(pc.readable()) + if(pc.readable()) { select_0 = pc.getc(); - while(1) + pc.printf("\n"); + menu_0 = 0; + switch(select_0) { - if(select_0 == 1) + case('1') { - if(Menu_1 == 0) - { - pc.printf("Select pattern \n"); - pc.printf("Input 1 for pattern1 \n"); - pc.printf("Input 2 for pattern2 \n"); - pc.printf("Input 3 for Exit!!\n"); - Menu_1 = 1; - } - if(pc.readable()) - { - select_1 = pc.getc(); - if(select_1 == 1) - { - Out1 = 1; - Out8 = 1; - wait_ms(min); - Out1 = 0; - Out8 = 0; - wait_ms(min); - Out2 = 1; - Out7 = 1; - wait_ms(min); - Out2 = 0; - Out7 = 0; - wait_ms(min); - Out3 = 1; - Out6 = 1; - wait_ms(min); - Out3 = 0; - Out6 = 0; - wait_ms(min); - Out4 = 1; - Out5 = 1; - wait_ms(min); - Out4 = 0; - Out5 = 0; - wait_ms(min); - Out3 = 1; - Out6 = 1; - wait_ms(min); - Out3 = 0; - Out6 = 0; - wait_ms(min); - Out2 = 1; - Out7 = 1; - wait_ms(min); - Out2 = 0; - Out7 = 0; - wait_ms(min); - Out1 = 1; - Out8 = 1; - wait_ms(min); - Out1 = 0; - Out8 = 0; - wait_ms(min); - Menu_1 = 0; - } - else if(select_1 == 2) - { - Out1 = 1; - Out2 = 1; - Out3 = 1; - Out4 = 1; - Out5 = 1; - Out6 = 1; - Out7 = 1; - Out8 = 1; - wait_ms(min); - Out1 = 0; - Out2 = 0; - Out3 = 0; - Out4 = 0; - Out5 = 0; - Out6 = 0; - Out7 = 0; - Out8 = 0; - wait_ms(min); - Menu_1 = 0; - } - else if(select_1 ==3) - { - Menu_0 = 0; - Menu_1 = 0; - break; - } - } + pc.printf("Pattern\n;"); } - if(select_0 == 2) + case('2') { - if(Menu_2 == 0) - { - pc.printf("Read Switch\n"); - pc.printf("Input 3 for Exit!!"); - Menu_2 = 1; - } - if(pc.readable()) - { - select_2 = pc.getc(); - if(select_2 == 3) - { - Menu_2 = 0; - Menu_0 = 0; - break; - } - else - { - if(In1 == 1){pc.printf("1");} - else if(In1 == 0){pc.printf("0");} - } - } - } + pc.printf("Read Status\n") + } } - } - } + } + } }