Reading Lego Motor Encoders


#1

Hi,

Do you have any sample code and/or instructions for reading the data off of the Lego NXT motor encoders?

Thanks so much!

Amy


#2

Hi Amy,

In the Bricktronics arduino libraries we use the PJRC encoder library, which is rock-solid and very high-performance:
http://www.pjrc.com/teensy/td_libs_Encoder.html

If you are using any of the Bricktronics hardware, you can just use the Bricktronics or Bricktronics Megashield arduino library to read the motor position from the encoders:

We also have some simple design docs that discuss motor position feedback using rotary encoders:
http://www.wayneandlayne.com/bricktronics/design-and-theory/ (near the end of the page)

Let us know if you need any additional information.