Shop OBEX P1 Docs P2 Docs Learn Events
How do you write a program for a rotary encoder in BS2 — Parallax Forums

How do you write a program for a rotary encoder in BS2

ECSimsECSims Posts: 19
edited 2007-11-05 16:19 in BASIC Stamp
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!!

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-11-03 11:57
    ECSims -

    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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • ECSimsECSims Posts: 19
    edited 2007-11-04 06:25
    Hello Bruce,

    Thanks for the link.· It looks like a lot of information, but I will sort through it.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-11-05 16:19
    Hello,

    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
Sign In or Register to comment.