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.
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut myled(LED1); // PA_5 alias LED1 00004 DigitalIn mybutton(BUTTON1,PullUp); // PC13 alias BUTTON1 00005 int bState, waitforpress=1, led_state=0; 00006 int main() 00007 { 00008 while(1) { 00009 bState = mybutton; 00010 if(waitforpress) { //Ha lenyomásra várunk és 00011 if(!bState) { //Ha lenyomás történt... 00012 led_state = !led_state; //LED állapotának átbillentése 00013 myled = led_state; 00014 waitforpress = false; //Következő stáció: felengedésre várunk 00015 } 00016 } else { //Ha felengedésre vártunk és 00017 if(bState) { //Ha felengedést észlelünk... 00018 waitforpress = true; //Következő stáció: lenyomásra várunk 00019 } 00020 } 00021 wait(0.02); // 20 ms pergésmentesítő késleltetés 00022 } 00023 }
Generated on Sat Jul 16 2022 17:50:14 by
1.7.2