View Single Post
  #1   Spotlight this post!  
Unread 05-02-2012, 16:10
kairichingu kairichingu is offline
Registered User
FRC #2437
 
Join Date: Jan 2012
Location: Hawaii
Posts: 2
kairichingu is an unknown quantity at this point
stop loop with encoder

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!
Attached Thumbnails
Click image for larger version

Name:	encoder code.PNG
Views:	27
Size:	19.6 KB
ID:	11739  
Reply With Quote