vjezba5
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:878ef2de4ada
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 08 17:05:39 2015 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +DigitalOut redled(p5); +DigitalOut greenled(p6); +DigitalIn sw1(p7); +int n=0; +bool b= false; +int main() { + while(1) { + + if (sw1!=b){ + wait(0.1); + if(sw1==1){ + n++; } + b = sw1; + + } + + if (n>=10){ + redled = 1; + } + +} +} \ No newline at end of file