瀏覽代碼

Added test movement script

Toby Chui 10 月之前
父節點
當前提交
31d3c30334

+ 8 - 0
firmware/cute_useless_robot/logics.ino

@@ -0,0 +1,8 @@
+/*
+  Main logic handlers
+
+  This file store the behavior of the robot
+  when the switch is pressed
+
+*/
+

+ 13 - 0
firmware/cute_useless_robot/servo.ino

@@ -24,6 +24,19 @@ void pushSwitchDelayed(int coverDelay, int pusherDelay) {
   servoSwitchPusher.write(0);
 }
 
+//Push with a pause before the switch is pushed
+void pushWithHesitation(){
+  servoCoverPusher.write(90);
+  delay(1000);
+  servoSwitchPusher.write(90 + servoAlignmentOffset);
+  delay(2000);
+  servoSwitchPusher.write(130 + servoAlignmentOffset);
+  delay(2500);
+  servoCoverPusher.write(0);
+  servoSwitchPusher.write(0);
+}
+
+
 //Set the pusher servo to arm installation position
 void setSwitchToInstallPosition(){
   servoSwitchPusher.write(125 + servoAlignmentOffset);

+ 6 - 1
firmware/cute_useless_robot/tasks.ino

@@ -108,7 +108,12 @@ void PrimaryController( void * pvParameters ) {
       setAnimationCode('a');
       delay(4000);
       Serial.println("ON");
-      pushSwitchNow();
+      rotateAntiClockwise(50);
+      rotateClockwise(100);
+      rotateAntiClockwise(100);
+      rotateClockwise(50);
+      delay(2000);
+      pushWithHesitation();
       clearFrame();
       delay(3000);
     }else{