Start of project 2

Dependencies:   Motor Servo mbed mbed-rtos

Revision:
2:60a8105d0d20
Parent:
1:7133819e4265
Child:
4:a3e95c9d56d5
--- a/main.cpp	Tue Oct 09 13:30:18 2018 +0000
+++ b/main.cpp	Tue Oct 09 13:40:51 2018 +0000
@@ -2,12 +2,14 @@
 #include "stdio.h"
 #include "Motor.h"
 #include "math.h"
+#include "Servo.h"
 
 int s1, s3, s4, i;
+float x;
 DigitalIn swtch1(p19);
 DigitalIn swtch3(p20);
 DigitalIn swtch4(p21);
-
+AnalogIn turn(p22);
 Motor m(p26, p30, p29);
 
 Servo back(p21);
@@ -35,4 +37,13 @@
       
       }//end of while loop
       
+      
+      while (1)
+      {
+        x = turn.read();
+        angle = x;
+        wait (.05);
+          
+          } //end of while loop
+      
     } //end of int main