Need help with Encoders!!

Is there any way of having the encoder measure the maximum distance it moved and then resetting it back to 0?

The encoder itself will not do this, but your own program can read the encoder’s value and keep track of the largest reading. What language are you using?


If you put the attached snippet in Teleop or inside a loop in Periodic Tasks, it should keep track of the maximum distance reported by the encoder as long as the “Reset” boolean is False. The True case resets the encoder and has a constant 0 wired to the output tunnel.

(The attachment is a VI Snippet. Save it and drag it into a LabVIEW block diagram and it will become live code.)

encoder max.png

encoder max.png

“Wpi Robotics Library\Sensors\Encoders\Reset”

This vi resets the count of the encoder to “0”.

Thank You!