![](/media/cache/group/AET.jpg.50x50_q85.jpg)
Himna
Dependencies: mbed
Fork of fistrek_intenzitetdiode by
Diff: main.cpp
- Revision:
- 3:c9b8b2a4d481
- Parent:
- 2:913f33d69e70
- Child:
- 4:a3ec775f889b
diff -r 913f33d69e70 -r c9b8b2a4d481 main.cpp --- a/main.cpp Thu Dec 10 14:47:20 2015 +0000 +++ b/main.cpp Thu Dec 10 14:51:21 2015 +0000 @@ -1,17 +1,18 @@ #include "mbed.h" int main() { - DigitalOut led(LED1); + DigitalOut led(LED1); DigitalIn sw(p5); - sw.mode(PullUp); - float ts=0.5; - while(1) { - led = 1; - wait(ts); - led = 0; - wait(ts); - if (sw==1) { - ts=ts/2.0; + sw.mode(PullUp); + int counter=0; + while(1) + { + if (sw==1) + { + counter++; } - } - } \ No newline at end of file + if((counter%9)==0){ + led = 1; + } + } + } \ No newline at end of file