From 1a8882ee435d6096f3b01b5fbe3e8b40bf58e24f Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sat, 4 Oct 2014 16:39:52 -0700 Subject: [PATCH] Committing working changes --- src/Zaphod.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Zaphod.cpp b/src/Zaphod.cpp index dc51a85..4268692 100644 --- a/src/Zaphod.cpp +++ b/src/Zaphod.cpp @@ -283,7 +283,14 @@ public: //{{{shooter_fire bool shooter_fire(bool shooter_clear, float shooter_speed, float shooter_max_angle, float shooter_current_angle){ //Fire the shooter motors at the given shooter_speed while the shooter_max_angle hasn't been hit and that it is clear to shoot - if(shooter_max_angle>=shooter_current_angle && shooter_clear==true && shooter_speed >= 15){ + if(shooter_clear==true){ + printf("Shooter clear"); + }else{ + printf("Shooter not clear"); + } + printf("Max angle: %f, Current angle: %f, shooter_speed: %f\n",shooter_max_angle,shooter_current_angle,shooter_speed); + if(shooter_max_angle>=shooter_current_angle && shooter_clear==true){ + printf("Shooting @ %d",shooter_speed); setMotorValue(4,1,cvt(shooter_speed)); setMotorValue(5,1,cvt(shooter_speed)); setMotorValue(4,2,cvt(-shooter_speed)); @@ -532,7 +539,7 @@ public: //Lower Shooter{{{ if(currentStep==3){ if(40.0f<=potToDegrees(armPot.GetAverageVoltage())){ - shootRobot(-0.3f); + shootRobot(-0.1f); }else{ shootRobot(0.0f); } @@ -661,7 +668,7 @@ public: } if(shooter_fired(2)==true){ //After the shooter has fired, lower the shooter arm then reset the whole shooting sequence - shooter_lower(-0.1, 40, potToDegrees(armPot.GetAverageVoltage())); + shooter_lower(-0.1, 47, potToDegrees(armPot.GetAverageVoltage())); } } if(shooter_idle==true){ @@ -687,4 +694,4 @@ public: } //}}} }; -START_ROBOT_CLASS(RobotDemo); \ No newline at end of file +START_ROBOT_CLASS(RobotDemo);