Go Down

Topic: UNO R3 (sda-scl and pins 4-5) (Read 3594 times) previous topic - next topic

Tilemachos

Hello everyone.
Can I use sda-scl pins for an lcd and pins 4 and 5 as buttons or sensors, in the same time?

retrolefty


Hello everyone.
Can I use sda-scl pins for an lcd and pins 4 and 5 as buttons or sensors, in the same time?


on a Uno type board SDA & SCL are on analog input pins A4 and A5. If you are going to use the I2C functions then you must not use those same pins for buttons and sensors.

Lefty

Tilemachos

Thank you Lefty.
So why is there also sda/scl pins in R3?

KirAsh4

They're just broken out and labeled as SCL/SDA.  It's still the same A4 and A5 pins.  They brought out the TWI pins next to the AREF pin for a reason.  Read the documentation online to understand why.

magagna


So why is there also sda/scl pins in R3?


The ATMega328 used on the Uno uses A4 & A5 for I2C, so for the Uno they're the same pins.

On the Leonardo, however, the ATMega32U4 uses pins D2 and D3 for I2C. The Due also uses something other than A4/A5.

If a shield needs I2C connectivity and uses A4/A5 it will only work with a Uno (and the older 328/168 boards). If a shield uses the SCL/SDA pins, however, it should work with all the Arduinos (except the old ones, which don't have those pins)
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Go Up