First time post, be gentle.
Using Arduino Uno with XD-204 XD-05 Data Logger Shield I purchased from makershop.de.
In my code I have included…
<SPI.h> (SPI comms) and <SD.h> (SD card)… both needed to make SD card operational
<Wire.h> (I2C comms) and … both needed to make RTC functional
For testing I have a simple 10K pot between 0/5VDC and the wiper taken to analog input.
I run a simple loop reading the analog input A0 to A5 depending what input I have my pots wiper connected to. Then convert and print/save date, time, ADCvalue and converted Voltage.
Everything works if I use A0 to A3 (ADCreading 0-1023, converted to volts 0.0-5.0 or thereabouts).
Here’s the big question…
Can I use A4 and/or A5 for analog inputs AT THE SAME TIME as using the I2C/RTC libraries mentioned above?
If I try to use A4 or A5 then the program ‘hangs’ (just stops stalls/stops) if the ADCreading is less than ~550 or more than ~1015 (pot turned up or down). As I return the pot to the middle ground the program keeps running.
Only after puzzling on this for a long while did I realize A4/A5 have that dual purpose for I2C SDA/SCL… I am guessing this is a problem if I try to read analog values at same time using those pins?
I need 6 analog inputs in my experiment. My courses of action seem to be…
- Different model (Nano perhaps)
- Find alternate to I2C based RTC… Any recommendations?
- Find an analog input expansion module that I can use via I2C or SPI… Any recommendations
Thank you for any advice.