Thread: Rotary encoder problems
07-20-2016, 05:37 PM #1
- Join Date
- Jul 2016
- United Kingdom
Rotary encoder problems
Im trying to finish my autopilot for a crj700 simulator. All the buttons and lights i have got working but im having alot of trouble with the rotary encoders. Im using two arduino unos for the autopilot, 1 for buttons and one for lights. everything but the encoders are working.
i dont know if they are full cycle, half cycle or quarter cycle.
I have tried the quarter cycle demo code as it can also determine the type of encoder. ( the encoder im testing first is on pins 18 & 19.) It says if it produces 1 up or down its quarter cycle, 2 for half and 4 for full. What i get is some sort of random mix of 3 ups and downs which I have no idea whats going on and as there are 3 values i cant determine what type of encoder they are.
no matter what i try to do the more i try the problem seems to get worse. ive have also tried the normal demo with similar results.
any help is much appreciated
many thanks, george, 15
Last edited by george gohl; 07-20-2016 at 05:37 PM. Reason: spelling and grammar
07-21-2016, 11:25 AM #2
Re: Rotary encoder problems
Do you have any I2C devices attached? Pins 18 & 19 are also SDA and SCL. Check Jim's rotary encoder post http://www.jimspage.co.nz/encoders2.htm to use on UNO pins higher than 14. Copy your sketch to another file and try the encoder on two other pins.
Identify full cycle encoders by doing a continuity check on the outside pins. When the encoder is half way between detent positions there should continuity between pins. Half cycle encoders I have seen are not as consistent but should give you an indication of continuity at every other detent position. Theory says quarter cycle encoders every fourth.
Hugh---CYXD ----- TWR --- GND ------ Closed
ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013