How do you write a program for a rotary encoder in BS2
ECSims
Posts: 19
Hello,
I am having trouble programming an optical 2-bit gray-code quatrature rotary encoder using the BS2 microcontroller.· I have read and re-read the article from Nuts and Volts, Oct 1995, but I can't seem to figure out how to make it work with BS2.· (The program was written for BS1)· Can anyone share some source code that would allow me to identify the position and direction of rotation of the rotary encoder?
Thanks!!
I am having trouble programming an optical 2-bit gray-code quatrature rotary encoder using the BS2 microcontroller.· I have read and re-read the article from Nuts and Volts, Oct 1995, but I can't seem to figure out how to make it work with BS2.· (The program was written for BS1)· Can anyone share some source code that would allow me to identify the position and direction of rotation of the rotary encoder?
Thanks!!
Comments
These Stamp applications notes (link below) should help you to understand 2-bit Grey encoding, finite state machines, and how they can be handled with a BS-2 Stamp. Thanks go to Dr. Tracy Allen.
http://www.emesystems.com/BS2fsm.htm#twobit
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks for the link.· It looks like a lot of information, but I will sort through it.
I also attached a couple of examples to a message at the following thread which you may find useful. Take care.
http://forums.parallax.com/showthread.php?p=653618
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support