Pages: [1]   Go Down
Author Topic: UNO R3 (sda-scl and pins 4-5)  (Read 3102 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Pages: [1]   Go Up
Jump to: