View Full Version : Any Code needed for an Encoder Sensor
Pike3543
02-02-2015, 15:31
I'm looking to get a AS5304 working for our bot but I'm not sure if any code is needed and overall how to get a signal from it. Anything important I should know?
Code will definitely be required. The form is very much dependent on which language you're programming your robot in. For Java or C++, you would extend the Encoder class or the CounterBase class, depending on whether you're interested in measuring speed/RPMs or distance/angle of rotation.
Pike3543
02-02-2015, 16:04
I'm looking for distance and to just overall get some sort of reading from it.
I'm using C++. Is there any example code I could use and customize to do what I want it to.
I'm looking for distance and to just overall get some sort of reading from it.
I'm using C++. Is there any example code I could use and customize to do what I want it to.
The code you want is in WPILib.
http://wpilib.screenstepslive.com/s/4485/m/13810/l/241875-encoders-measuring-rotation-of-a-wheel-or-other-shaft
Pike3543
02-02-2015, 21:50
Thanks this is very helpful
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.