Ok, that was a long title, but what does it mean? I have a ham radio buddy that wants to control a variable capacitor with his Arduino. I’m using a Rotary Encoder (digital) for precision instead of a potentiometer (analog) to control the angle of a Servo. The values are constrained to only legitimate values the servo can use.
This project is based on two of my previous articles:
Using a Rotary Encoder with the Arduino
The problem we ran into, was that at power down, a rotary encoder does not retain it’s position information, so when you power back up, you start back at zero. I added a few lines that writes the current position to EEPROM every time there is a change, so that on power up, the servo returns to the last known position.
Next modification is to add a LCD display instead of using the serial monitor.
Code – http://tny.cz/06b56746
does not work. with your code my rotary encoder works like a pot, without step, simply continue rotation CW or CCW
Ah, but is does work, as you can see in the image. You may have a wiring or other technical issue, but rotary encoders are not like pots, they don't do "resistance".