소스 검색

Added test movement script

Toby Chui 10 달 전
부모
커밋
31d3c30334
3개의 변경된 파일27개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 0
      firmware/cute_useless_robot/logics.ino
  2. 13 0
      firmware/cute_useless_robot/servo.ino
  3. 6 1
      firmware/cute_useless_robot/tasks.ino

+ 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{