HP encoder to basic stamp???
I've got an HP rotary encoder tied to IN1 and IN2 of my homework board.· I read 1's and 0's on the A and B channels·when I rotate the shaft so I think it's working.
Does anyone have a simple code that will allow the count to increase per pulse read when I turn the shaft one direction, then decrease the count when I turn the shaft the other direction?· I'm still new to stamps and am having a tough time figuring it out.
Thanks!
Does anyone have a simple code that will allow the count to increase per pulse read when I turn the shaft one direction, then decrease the count when I turn the shaft the other direction?· I'm still new to stamps and am having a tough time figuring it out.
Thanks!
Comments
I've dont it myself a few times, but I don't have the code with me here. I'll see if I can post something tonight. In the meantime, Jon might have something to say too. I vaguely recall he's done some rotary encoder work...
-dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
This is not a sig. This is a duck. Quack.
Regarding Dave's comment, the other encoder project I did recently was with the SX and the SX/B compiler.· Take a look:
http://forums.parallax.com/showthread.php?p=519708
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 12/13/2004 3:25:33 PM GMT
owlogic.com/BS2fsm.htm#twobit%20encoder
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
The program worked although I noticed the encoder has to be turned very slowly or it seems to lose count.
The encoder I'm using is 512 cpr.
I may try one that has less resolution.
Thanks again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
To join the discussion about the rotary encoders:
I have a bit of a strange encoder from an SONY minidisc.
the output is: 0-231-0-231-0-231-0-231-0 This means that it's starting and ending position = 0 (A=0, B=0)
So I cannot do the XOR trick (or can I???) If I give this encoder 1 click (CW or CCW) it gives '231' to the outputs and then goes to '0' That means that there isn't a position with 1(01) or 2(10) or 3(11) as state, if this encoder is in rest it gives '0'(00)
Anyone familiar with this kind of encoder?? And know how to handle this??
I tried several programms even the one with the: lookup old*4+new,[noparse][[/noparse]0,1,-1,0,-1,0,0,1,1,0,0,-1,0,-1,1,0],x··· (This only works when I turn the encoder very slow)
Best regards,
Henk Witteveen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Name: Bruce Clemens
Work:· Clemensb@otc.edu
Bolg: http://theDeadBug.journalspace.com
·· I admire that...Trying something out with absolutely no application in mind.· Simply to see if it works...And you never know when that might come in handy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
If it's one of Agilent's RPG. Rotary Pulse Generators, then it outputs serial data in the form of Gray code, not necessarily Quad encoded pulses. I've got three here. Plus the chips that they talk to. However it's an interesting device, you could call it Quadrature, but its really Gray code.
Gray code was concieved with things like this in mind.·You can state more data with fewer bits. If anyone is really curious, contact me off board, and I'll track down my notes on the subject.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buck Rogers
www.gregg.levine.name