wefewf

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
JostBaus
Date:
Fri Feb 08 13:47:17 2019 +0000
Parent:
0:31bfb8d89abd
Commit message:
Fixed some problems^^

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 31bfb8d89abd -r 5be01136a518 main.cpp
--- a/main.cpp	Fri Feb 08 13:38:35 2019 +0000
+++ b/main.cpp	Fri Feb 08 13:47:17 2019 +0000
@@ -36,7 +36,7 @@
 void printV();
  
  
-Ticker ticker1;
+//Ticker ticker1;
 Ticker slf1;
 Ticker slf2;
 Ticker slf3;
@@ -46,7 +46,7 @@
 int main ()
 {
     led1 = 1;
-    ticker1.attach(&printV, 0.7);
+    //ticker1.attach(&printV, 0.7);
     slf1.attach(&sloyfe1, 0.7);
     slf2.attach(&sloyfe2, 0.7);
     slf3.attach(&sloyfe3, 0.7);
@@ -69,14 +69,14 @@
 }
  
  
-void printV()
+/*void printV()
 {
-    //pc.printf ("ain1 = %f\n\r", s11 * 3.3);
-    //pc.printf ("ain2 = %f\n\r", s12 * 3.3);
-    //pc.printf ("%f\n\r", s13 * 3.3);
-    //pc.printf ("%f\n\r", s14 * 3.3);
+    pc.printf ("ain1 = %f\n\r", s11 * 3.3);
+    pc.printf ("ain2 = %f\n\r", s12 * 3.3);
+    pc.printf ("%f\n\r", s13 * 3.3);
+    pc.printf ("%f\n\r", s14 * 3.3);
     
-}
+}*/
 
 void sloyfe1()
 { 
@@ -85,11 +85,6 @@
     if (ain1 > 2.33 && ain1 < 2.28)          //Vanlig state 
     {
         pc.printf("OK");
-        led = 0;
-        led1 = 0;
-        led2 = 0;
-        led3 = 0;
-        led4 = 0;
     }
     else
     {
@@ -147,7 +142,7 @@
        led = who;
        led3 = 1;
        led4 = 1;
-       
+       blinkON.attach(&blink, 0.1);
     }
         
     else if (value > 0.879 && value < 0.862)   //Dør 1 åpen
@@ -155,7 +150,7 @@
         pc.printf("Door 1 is open in s%d\n\r", who);
         led = who;
         led3 = 1;
-        
+        blinkON.attach(&blink, 0.1);
     }
         
     else if (value > 0.736 && value < 0.721)   //Dør 2 åpen
@@ -163,7 +158,7 @@
         pc.printf("Door 2 is open in s%d\n\r", who);
         led = who;
         led4 = 1;
-        
+        blinkON.attach(&blink, 0.1);
     }
         
     else if (value > 2.92 && value < 2.86)    //Dør 1 kortsluttet
@@ -171,6 +166,7 @@
         pc.printf("Short Circuit at Door 1 in s%d\n\r", who);
         led = who;
         led3 = 1;
+        blinkON.attach(&blink, 0.1);
         
     }
         
@@ -179,6 +175,7 @@
         pc.printf("Short Circuit at Door 2 in s%d\n\r", who);
         led = who;
         led4 = 1;
+        blinkON.attach(&blink, 0.1);
         
         
     }