My goal is to reduce pins being used for micro-controllers with limited pins, or projects requiring a few different digital input values.
How I intend to do so is by using ADC pins to gather four specific different values through resistors with analogRead, which would otherwise need 2 pins (!A+!B, !A+B, A+!B, and A+B).
value = analogRead(adcPin1) >> 8;
This would give, if properly wired, 4 possible results like some sort of "Quartary bit", as analogRead yields a 10-bit response.
So my questions are the following:
- Can analogRead be sufficiently reliable to tell the difference between four possible values?
- What would the wiring/casing/etc. need to look like to prevent any errors?
Thanks!