|
On a small project I was doing, I ran short of a few digital inputs where I was using an Arduino Nano, to implement a few extra inputs, I used a couple of resistors to form a standard potential divider into an Analog input. Then used internal 'flags' in the ARDUINO sketch to differentiate the analog inputs to give 3 different values, these indicate if one or the the other, or both inputs are 'active' ... and the ARDUINO Sketch 'code' then 'sets' the two 'flags' for their states, with the resistor values used, the voltage separation is more than adequate.
|