Testing Pushbutton states
Dependencies: mbed
Fork of VJEZBA5Pavlek by
Diff: main.cpp
- Revision:
- 0:a2f342ac8251
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 08 17:39:15 2015 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +DigitalIn sw1(p5); +DigitalOut out1(p10); +int i; +int main() { + + sw1.mode(PullUp); + out1=0; + while(1){ + if(sw1==0){ + + if(sw1==1){ + i=i++; + + if(i==3){ + out1=1; + } + } + } + } + } + +