I am trying to understand this rotary encoder I have, but it makes no sense to me.
I am using this rotary encoder: https://www.amazon.com/gp/product/B07DM2YMT4/
CYT1100 aka CY110 aka EC11
I am using this wiring: https://i.sstatic.net/aMyR5.png
P2 is the "push button" and it gives continuity when pressed.
I am using a knock off arduino nano and this is my simple script:
#define PIN_CLK 2
void setup()
{
Serial.begin(9600);
pinMode(PIN_CLK, INPUT);
}
void loop()
{
auto val = digitalRead(PIN_CLK);
Serial.println("CLK:" + String(val));
}
Where PIN_CLK is connected to A (DW) or B (CLK) in the diagram.
My expectation is that A and B should be either a constant HIGH or LOW depending on where the brushes are internally. Not switching to HIGH or LOW for a moment and then returning to what it was before.
When I check them with my multimeter, they are both always 5v (when its not making loose contact on the breadboard).
The serial plotter says its switching between HIGH and LOW repeated:
https://i.sstatic.net/6VC3z.png
Same with the Serial monitor:
https://i.sstatic.net/wAk0v.png
When I spin the encoder, it gives me gaps of LOW in the output like this:
https://i.sstatic.net/lOUmx.png
If I hold my index and thumb against P1 (5v) and A (CLK) while spinning the encoder. I get constant stream of HIGH with a LOW on every notch spin:
https://i.sstatic.net/CzUwV.png
Can someone explain this behavior and how this encoder is suppose to work?
Edit: I tried this schematic:
https://i.sstatic.net/Mlj1l.png
Whenever I turn the encoder. The LED blinks for a few milliseconds. Then turns off.
Is it suppose to stay solid depending on the 2 bit states?