Reading of rotary encoders , how to ?
Hi !
I want to read the output for rotary encoders but I am not sure how.
regards
tobon48
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
I want to read the output for rotary encoders but I am not sure how.
regards
tobon48
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.

Comments
·
Thank you very much, I think it will solve my problem . ( Other good things there !)
Regards
tobon48
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
Read_Encoder: newBits = INA & %0011 oldBits = newBits DO newBits = INA & %0011 ' Get State Of I/O Pins 0, 1 IF newBits <> oldBits THEN ' Have Bits Changed? setTemp = setTemp - 1 + (2 * (newBits.BIT0 ^ oldBits.BIT1)) MIN 450 MAX 550 GOSUB Show_Temp oldBits = newBits ' Update oldBits ENDIF LOOP▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
@Chris
How can I determin which way the encoder goes ? or do you just want to show me the handling of bits ?
regards
tobon48
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I have tested and it worked fine, but I dont really understand the logic of the math. I have to read more about rotary encoders and PJ Allens exellent link.
regards
tobon48
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com