ServoRobotArm

Dependencies:   mbed BufferedSerial LSCServo DC_Stepper_Controller_Lib

Files at this revision

API Documentation at this revision

Comitter:
stivending
Date:
Thu Jun 03 07:42:11 2021 +0000
Parent:
0:901a3ec83ba4
Commit message:
working @ 3pm Jun 3

Changed in this revision

DC_Motor_Controller_Lib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 901a3ec83ba4 -r 1eb3a5a00fbb DC_Motor_Controller_Lib.lib
--- a/DC_Motor_Controller_Lib.lib	Thu Jun 03 04:56:59 2021 +0000
+++ b/DC_Motor_Controller_Lib.lib	Thu Jun 03 07:42:11 2021 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/Robocon-2021/code/DC_Stepper_Controller_Lib/#87df75ee8731
+https://os.mbed.com/teams/Robocon-2021/code/DC_Stepper_Controller_Lib/#3a1b95e2ecb8
diff -r 901a3ec83ba4 -r 1eb3a5a00fbb main.cpp
--- a/main.cpp	Thu Jun 03 04:56:59 2021 +0000
+++ b/main.cpp	Thu Jun 03 07:42:11 2021 +0000
@@ -1,8 +1,3 @@
-/*******************************************************
-              DC MODOR CONTROLLER LIBRARY
- *******************************************************           
-         IMPORTANT: GO TO README FOR DOCUMENT!
-********************************************************/
 
 #include "mbed.h"
 #include "LSCServo.h"
@@ -27,24 +22,28 @@
     }
     
     wait(0.5);
-    motor.reset();
+    //motor.reset();
     wait(0.5);
-    motor.move_angle(615);
-    wait(2);
-    
-    robot_arm.moveServos(3,1000,2,185,3,560,4,0); // initial pos to put an arrow
+    motor.move_angle(620);
     wait(2);
     
-    robot_arm.moveServos(3,1000,2,185,3,560,4,800); // catch/crawl the arror
-    robot_arm.moveServos(3,1000,2,185,3,190,4,800); // rotate down
-    wait(2);
-    robot_arm.moveServos(3,1500,2,760,3,190,4,800); // rotate left
-    wait(2);
-    
-    robot_arm.moveServos(3,1000,2,580,3,190,4,0); // open the crawler
-    //robot_arm.moveServos(3,1000,2,600,3,190,4,0); // rotate a little back
-    motor.move_angle(420);
-    
-    robot_arm.moveServos(3,1000,2,185,3,560,4,0); // reset to init
-    
+    for(int i =0; i < 5; i++)
+    {
+            
+        robot_arm.moveServos(3,1000,2,185,3,560,4,0); // initial pos to put an arrow
+        wait(2);
+        
+        robot_arm.moveServos(3,1000,2,185,3,560,4,800); // catch/crawl the arror
+        robot_arm.moveServos(3,1000,2,185,3,190,4,800); // rotate down
+        wait(2);
+        robot_arm.moveServos(3,1500,2,760,3,190,4,800); // rotate left
+        wait(2);
+        
+        robot_arm.moveServos(3,1000,2,560,3,190,4,0); // open the crawler
+        //robot_arm.moveServos(3,1000,2,600,3,190,4,0); // rotate a little back
+        motor.move_angle(412);
+        
+        robot_arm.moveServos(3,1000,2,185,3,560,4,0); // reset to init
+    }
+            
 }
\ No newline at end of file