My Arduino pins are full! I have an RFID reader using SPI, a PIR sensor, an LCD and a 74HC595 controlling LEDs!
The only pins I have left are A1, A2, D2 and D3 which are being used for this.
So the reason I am going from digital to analog back to digital again is I have to. I know the internal ADC will work - using a potentiometer, but I can't get this external DAC to work.
I've also tried using an R-2R Ladder like this attached to the switch rather than Arduino, which works well
I get
Value: 000 Voltage: 0.00 Address: 000 Data: 0x7E
Value: 098 Voltage: 0.47 Address: 001 Data: 0x30
Value: 179 Voltage: 0.87 Address: 002 Data: 0x6D
Value: 261 Voltage: 1.27 Address: 004 Data: 0x33
Value: 317 Voltage: 1.54 Address: 004 Data: 0x33
Value: 400 Voltage: 1.95 Address: 006 Data: 0x5F
Value: 461 Voltage: 2.25 Address: 007 Data: 0x70
Value: 532 Voltage: 2.60 Address: 008 Data: 0x7F
Value: 539 Voltage: 2.63 Address: 008 Data: 0x7F
Value: 618 Voltage: 3.02 Address: 009 Data: 0x7B
Although address 3 to 7, except 4, read too high?
As I change the switch I expect to see the voltage change and the Arduino use it's ADC to convert it to an integer I can use to access the EEPROM addresses. It would be nice to use a DAC IC for ease.