LAB09_Oppgave2

Dependencies:   mbed

Fork of LAB09_Oppgave2 by EL-POM1001

Revision:
1:f0d090bf0578
Parent:
0:8f25416dc51e
diff -r 8f25416dc51e -r f0d090bf0578 main.cpp
--- a/main.cpp	Tue Oct 27 19:02:10 2015 +0000
+++ b/main.cpp	Thu Oct 29 11:19:48 2015 +0000
@@ -14,6 +14,7 @@
 {
     userLed=!userLed;     // Toogle user led
     direction=!direction; // Change motor direction
+    
 }
 
 int main()
@@ -25,7 +26,15 @@
     Gnd=0;
 
     while(1) {
-        servoMotor=aInn.read();
+        
+        if(direction)
+        {
+        servoMotor=(1-aInn.read());
+        }
+        else
+        {
+        servoMotor=(aInn.read());
+        }
     }
 
 }