Well, I am scratching my head for too long with this behavior that I do not understand.
I am not trying to accomplish anything with this project, but I can not manage to understand the values I am getting. The wiring is pretty straight forward as shown below:
I would have expected the same 1023 value when connecting the resistor to the ground. ( Those values are when I am not turning the encoder)
Could someone explain me why it is not, and what I am missing please?
In terms of the diagram on the left. Each encoder output is a switch that closes and opens when the shaft is rotated. Those encoders have pullup resistors on the encoder switches (pull the switch to Vcc when the switch is open). The closed switch pulls the output to ground. So as you rotate the shaft you should see 1023 (ish) when the switch is open and 0 (ish) when the switch is closed.
On the diagram on the right you have introduced another resistor (of unknown value) on the encoder output. That creates a voltage divider so that the open switch will read Vcc times the ratio of the onboard pullup and the unknown value added resistor. Closed switch should still read 0 (ish).
Hi! No no I know that it should be connected to the digital inputs.
Thing is, within my project, with the resistor connected to the ground, I was getting a LOW state where I was expecting a HIGH one. So then I wired it into an analog input just to check the voltage I was getting.