Applied engineering Team / Mbed 2 deprecated Fistrek_Lijepanasa

Dependencies:   mbed

Fork of fistrek_intenzitetdiode by Applied engineering Team

Files at this revision

API Documentation at this revision

Comitter:
ffistrek
Date:
Thu Dec 10 14:51:21 2015 +0000
Parent:
2:913f33d69e70
Child:
4:a3ec775f889b
Commit message:
Fistrek_vjezba_3.5

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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