Log in

View Full Version : C++ Encoder Help Needed


Frostivious
19-01-2014, 17:35
So this is our first year using c++ and we were wondering if anyone could help us get encoders working. Things we need to know is how to get it to print to Smart Dashboard, well actually we just need help in general...

Sparkyshires
19-01-2014, 19:57
for one, if I can ask, why do you need to print it to the dashboard? As to how else to use it, initialize it using the encoder class and check the WPI library for its functions. the main one's you need to know are .Get() which gives you the value, and .Reset() which resets the encoder.

phynix
19-01-2014, 20:31
You also need to Start() them, otherwise they won't begin counting.

Sparkyshires
19-01-2014, 21:43
You also need to Start() them, otherwise they won't begin counting.

Yup, thats true. I was just working with gyros, totally forgot sensors needed to be initialized xD

Dinoyan
19-01-2014, 21:51
Tutorials on C++ and Encoder (page 49)

http://first.wpi.edu/Images/CMS/First/C_CPP_Programming_Guide.pdf

Joe Ross
19-01-2014, 23:05
Tutorials on C++ and Encoder (page 49)

http://first.wpi.edu/Images/CMS/First/C_CPP_Programming_Guide.pdf

This document is quite old. The latest documentation is now at http://wpilib.screenstepslive.com/s/3120 (Getting Started with C++ and WPILib Programming). The encoder documentation is at http://wpilib.screenstepslive.com/s/3120/m/7912/l/85770-measuring-rotation-of-a-wheel-or-other-shaft-using-encoders