Speedy Retraction Team / Mbed 2 deprecated Nucleo_Dynamixel_18V

Dependencies:   Dynamixel Protocol Utilities mbed

Fork of Nucleo_Dynamixel_18V by Timofey Ilin

Revision:
7:761930a5373d
Parent:
6:414eb29191ad
Child:
8:ae31c62ed181
--- a/main.cpp	Sun Jul 10 05:06:52 2016 +0000
+++ b/main.cpp	Sun Jul 10 05:17:04 2016 +0000
@@ -164,8 +164,8 @@
     Base.setMovingSpeed(1024+speed);
     Elbow.setMovingSpeed(1024+2.3*speed); // was 1024+2.2*speed
     Wrist.setMovingSpeed(1024+1.4*speed);  
-    //Pan.setMovingSpeed(1024+0.3*speed);
-    //Tilt.setMovingSpeed(1024+0.3*speed);
+    Pan.setMovingSpeed(1024+0.3*speed);
+    Tilt.setMovingSpeed(1024+0.3*speed);
 }
 
 void setLimits() {
@@ -227,10 +227,10 @@
     setSpeed(100);
     uint16_t currentPosTilt;
     uint16_t currentPosPan;
-    //Pan.setCWAngleLimit(0);
-    //Pan.setCCWAngleLimit(4095);
-    //Pan.setGoalPosition(1850);
-    //Tilt.setGoalPosition(195);
+    Pan.setCWAngleLimit(0);
+    Pan.setCCWAngleLimit(4095);
+    Pan.setGoalPosition(1850);
+    Tilt.setGoalPosition(195);
     
     Base.setGoalPosition(60);
     Elbow.setGoalPosition(350);
@@ -256,17 +256,16 @@
         else if (echo == 97) {    panIncrementLeft();   }
         else if (echo == 100) {   panIncrementRight();   }
         else {  
-            continue;
             //Tilt.setMovingSpeed(1024);
             //Pan.setMovingSpeed(1024);
-            //currentPosPan = Pan.getPresentPosition();
-            //Pan.setGoalPosition(currentPosPan);
+            currentPosPan = Pan.getPresentPosition();
+            Pan.setGoalPosition(currentPosPan);
         }
     
-        //currentPosTilt = Tilt.getPresentPosition();
-        //pc.printf("Tilt Position: %d\r\n",currentPosTilt);
-        //currentPosPan = Pan.getPresentPosition();
-        //pc.printf("Pan Position: %d\r\n",currentPosPan);
+        currentPosTilt = Tilt.getPresentPosition();
+        pc.printf("Tilt Position: %d\r\n",currentPosTilt);
+        currentPosPan = Pan.getPresentPosition();
+        pc.printf("Pan Position: %d\r\n",currentPosPan);
         
             
         /*