In anticipation of adding an LED display module to an existing UNO R3 project, I find myself running out of I/O (surprise!) but to my shock and amazement I found two pins I didn’t know were there before.
Specifically, I am using a popular I2C LCD that for some reason everyone connects to A4 & A5 for SDA and SCL respectively. Having discovered those two pins D18 and D19, I simply relocated them, and the I2C display works as it always did.
This apparently frees A4 and A5 to be used for other purposes, without affecting the I2C LCD in any way whatsoever.
No. The SCL/SDA pins up by the USB connector are the same pins on the 328P as A4/A5. They're just brought out in two places. You can verify this yourself by using a multimeter to see that there is continuity between SDA and A4, and SCL and A5. Or by looking at the schematic.
The digits in the picture are incrementing as fast as the thing will go. It's been going on 24 hours. I want to see what dies first. The most expensive component set me back about $3.
1. It is not magic that A1 and A2 are working as digtal IO line!
2. On the Arduino UNO R3 board, we have the following legends:
0, ........., 7 8,.........,13; we read them as pin-0 (header pin-0), ......
A0, ......, A5 ; we read them as pin-A0 (header pin-A0), ....
3. After power up reset, the above header pins works as digital input lines. They can be easily as digital output lines by canging their direction as outputs using pinMode() function.
pinMode(A0, OUTPUT);
digitlaWrie(A0, HIGH);
4. A0 - A1 pins are called analog pins to mean that these lines carry exteranl analog sinals for the inernal ADC of the MCU when the ADC Module is enabled.
5. Fig-1 shows the possible alternate signals that A4 and A5 pins can connect for the internal respective modules:
When A1 is HIGH, then it can only source 20 mA; whereas Vcc-pin (5V) of UNO R3 can supply as much as 500 mA (ignoring the current taken by Arduino Board).
Similalry, when LOW is asserted on A1-pin, it can sink only 20 mA; whereas GND-pin can sink 500 mA.