We decided to use a VEX Encoder to measure our shooter’s angle, but we aren’t sure how to get the VEX Encoder to work with the cRIO, or if it is even possible.
Our team would appreciate it if you would share a sample code with us, (if possible), and the wiring schematics.
Thank you in advance.
Well, I honestly do not know if the encoder will read correctly, but go ahead and plug the two cables into the DIO ports on the digital breakout. Here is some basic code to get you started with the coding. You will most likely want to find home using a limit switch in autonomous.
Encoder Example.vi (27.5 KB)
Encoder Example.vi (27.5 KB)
Apparently, our team changed from the VEX Encoder to the AS5145B Magnetic Encoder, will the sample code also interface with it?
That kind of magnetic encoder is a much more appropriate sensor for reading the angle of a rotating component like an elbow joint or shooter elevation. The usual way to interface with it is to read an analog voltage it provides. Nothing fancy.