pin1,2,3,servo

Dependencies:   Servo Test2Boards LSCServo ros_lib_melodic DC_Stepper_Controller_Lib

Revision:
8:e0fc4ff343f8
Parent:
7:b878dce06561
Child:
10:9720882ee8ee
--- a/main.cpp	Sat Jun 12 09:23:05 2021 +0000
+++ b/main.cpp	Sat Jun 12 16:02:20 2021 +0000
@@ -79,13 +79,11 @@
     while(1){
         s5.wait();
         motor.set_out(0,0.4);
-        while(1)
+        while(!but)
         {
-           if(but){
-                motor.set_out(0,0);
-                break;
-           }
+            ;
         }
+        motor.set_out(0,0);
         motor.reset();
         motor.move_angle(-250);
     }
@@ -98,13 +96,11 @@
     while(1){
         s7.wait();
         motor.set_out(0,1);
-        while(1)
+        while(!but)
         {
-            if(but) {
-                motor.set_out(0,0);
-                break;
-            }
+            ;
         }
+        motor.set_out(0,0);
         motor.reset();
         motor.move_angle(-250);
     }   
@@ -218,7 +214,10 @@
 int main() {
     myled = 0;
     but.mode(PullUp);
-    
+    up = 0;
+    down = 0;
+    pusher1 = 0;
+    pusher2 = 0;
     motor.set_pid(0.008, 0, 0, 0.10);
     
     nh.getHardware()->setBaud(BAUD_RATE);   //set baud rate