balewski
Posts: 2
Joined: Sat Aug 23, 2014 1:48 am

C++ driver for LS7336 rotary encoder

Sat Dec 26, 2015 4:18 am

Hi,
I recently acquired a 400 P/R rotary encoder pulse counter
http://www.robotshop.com/en/pulse-count-module.html
which uses LFLS7366R for 32-BIT QUADRATURE COUNTER WITH SPI SERIAL INTERFACE

Since I could not find any C++ code talking to the LS7336 chip I wrote a small class
allowing to set MDR0, MDR1 registers of LS7336 and read the encoder position w/o
affecting incrementation of internal CNTR counter in LS7336. It uses WiringPi library for the low level SPI protocol.
The code is available in Bitbucket at:
https://bitbucket.org/balewski/malina/s ... ?at=master

Perhaps you find it useful for your projects
Thanks
Jan

Return to “Automation, sensing and robotics”