Our team is trying to control our arm with an encoder to make the motor start when we push a button and stop when the encoder reads a certain voltage. We are able to make the motor run, however we are unable to stop the motor when the encoder reads that voltage.
We set the loop condition to stop when true (when the voltage is greater than 3) through an accelerometer vi since we are reading voltage. We have tested the encoder with the Accelerometer Angle example, so I’m pretty sure that it is running correctly. I’ve attached our code below and we are stumped as to why it is not working. Also, we noticed that on the driver station the Analog Input gives different values than we expect. Could anyone tell us whether to base our numbers off the readings on the dashboard or the Accelerometer Angle example? Thank you!