RobotCasserole1736 / RobotCasserole2019

Software for Robot Casserole's 2019 FIRST Deep Space competition season
MIT License
5 stars 0 forks source link

Add limit switch reading and calibration to Arm #95

Closed gerth2 closed 5 years ago

gerth2 commented 5 years ago

The upper and lower limit switches will wire up to the Rev SparkMax limit switch ports. Configure the SparkMax so output is shut off in the approprate direction when the limit switch is activated.

Add in logic such that when the upper or lower switch is pressed, the measured angle of the arm is reset the the appropriate number. This is to say that there is some "angle offset" in the code which converts from the angle reported by the SparkMax to the physical angle. When the limit switch is pressed, you know the physical angle and the SparkMax reported angle, so you should be able calculate what the offset is.

imdunne8 commented 5 years ago

Just confirming - the Spark MAX does indeed turn off motor output in one direction when the corresponding limit switch is pressed.