int main()
{
led1 = 1;
led2 = 1;
ledthread = new Thread(led_thread, NULL, osPriorityAboveNormal);
button_pressed = 0;
sw3.fall(&sw3_press);
sw4.fall(&sw4_press);
while (true)
{
if( button_pressed == 1 )
{//SW3
kbd.keyCode(147,0);
Thread::wait(80);
button_pressed = 0;
}
else if( button_pressed == 2 )
{//SW4
kbd.keyCode(146,0);
Thread::wait(80);
button_pressed = 0;
}
else
Thread::wait(100);
}
}
|