Home > other >  College students' online to solve
College students' online to solve

Time:09-16

1, KEY1 has been pressed, LED0 bright, let go out; 2, KEY2 has been pressed, LED1, loosen the bright; 3, press KEY3 two lights flashing,


Embedded programming teacher give the assignment, should excuse me how?
Thank you bosses

CodePudding user response:

Separated into three steps:
1, KEY1 press output LED0=1, after let go LED0=0;
Output after 2, KEY2 press LED1=0, let go on LED1=1;
3, KEY3 press, can use the timer operation LED lights flashing, timing for a period of time

CodePudding user response:


If (KEY3==1)//assume that button press 0
{
LED0=KEY1;
LED1=KEY2;
}
The else
{

LED0=LED1=~ LED0;
Delay_ms (500);

}

CodePudding user response:

Built with the hardware? Even before the switch directly, the last one with a time delay circuit
  • Related