Gets user Input to turn the servo to certain degrees

Dependencies:   mbed

Revision:
6:27284b61ae0c
Parent:
3:5b6a55afc60a
Child:
7:78973b67cd90
diff -r 4fddb8f7d5cc -r 27284b61ae0c servo.cpp
--- a/servo.cpp	Sun Jan 13 22:21:56 2019 +0000
+++ b/servo.cpp	Sun Jan 13 22:33:48 2019 +0000
@@ -10,15 +10,14 @@
 void moveServo(char a){
     switch(a){
         case 1: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 2: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 3: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 4: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 4: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 5: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 6: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 7: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 8: servo.pulsdewidth_us(pulsewidth(-90)); break;
-        case 9: servo.pulsdewidth_us(pulsewidth(-90)); break;
+        case 2: servo.pulsdewidth_us(pulsewidth(-67.5)); break;
+        case 3: servo.pulsdewidth_us(pulsewidth(-45)); break;
+        case 4: servo.pulsdewidth_us(pulsewidth(-22.5)); break;
+        case 5: servo.pulsdewidth_us(pulsewidth(0)); break;
+        case 6: servo.pulsdewidth_us(pulsewidth(22.5)); break;
+        case 7: servo.pulsdewidth_us(pulsewidth(45)); break;
+        case 8: servo.pulsdewidth_us(pulsewidth(67.5)); break;
+        case 9: servo.pulsdewidth_us(pulsewidth(90)); break;
         }
     
     }