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
main.cpp
- Committer:
- kantapon501
- Date:
- 2015-10-20
- Revision:
- 3:2ffb7f153526
- Parent:
- 2:e9a626e1b717
- Child:
- 4:21ddb5cfccdf
File content as of revision 3:2ffb7f153526:
#include "mbed.h"
DigitalOut Out1(D13);
DigitalOut Out2(D12);
DigitalOut Out3(D11);
DigitalOut Out4(D10);
DigitalOut Out5(D9);
DigitalOut Out6(D8);
DigitalOut Out7(D7);
DigitalOut Out8(D6);
DigitalIn In1(D0);
Serial pc(SERIAL_TX, SERIAL_RX);
int main()
{
uint8_t menu_0=0;
uint8_t menu_1=0;
uint8_t select_0=0;
uint8_t select_1=0;
pc.printf("Hello Sir !!\n");
while(1)
{
if(menu_0 == 0)
{
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())
{
select_0 = pc.getc();
pc.printf("\n");
menu_0 = 0;
switch(select_0)
{
case('1'):
while(1)
{
if(menu_1==0)
{
pc.printf("Input 1 for Pattern1\n");
pc.printf("Input 2 for Pattern2\n");
pc.printf("Input 3 for Exit");
menu_1 = 1;
}
if(pc.readable())
{
select_1 = pc.getc();
pc.printf("\n");
menu_1 = 0;
switch(select_1)
{
case('1'): pc.printf("Pattern1\n"); break;
case('2'): pc.printf("Pattern2\n");break;
case('3'): break;
}
}
}
case('2'):
pc.printf("Read Status\n");
break;
}
}
}
}