Hallo,
i got a problem with using i2c with my arduinos. I hooked up the arduinos as shown in the pictures:
gnd - gnd
d4 - d4
d5 - d5
I tried several examples, the last one was the first demo scetch here:
I tried different Arduinos, different cables.... it wont work.
Greetings
I2C scanner
What did the I2C scanner report?
Are you sure that you are using the right pins on the Mega ?
i believe so.... pwm should be digital, shouldnt it?
i tried the i2c scanner on both arduino, same result: No i2c devices found
I meant the SDA and SCL pins on the Mega
See Wire - Arduino Reference
Did you try connecting the I2C wires on the Uno to the I2C pins of the Uno, A4 and A5?
Did you try connecting the I2C wires on the Mega to the I2C pins of the Mega?
HELLO, anyone there????
KNOCK! KNOCK!
ATTENTION!
SEE A4 AND A5 USED AS THE I2C pins? DID YOU TRY to properly connect your wires to the proper GPIO pins?
How many times will you need to read that your I2C wires are in the WORNG pins before you make the correction?
Yeah im sorry...
Hooked them up in analog, but its still not working.... no d
evices found
pfusch22:
Hooked them up in analog
Why did you do that on the Mega ?
They are the wrong pins !
From https://www.arduino.cc/reference/en/language/functions/communication/wire/ previously linked to (did you read it ?)
Hi,
When connecting UNO to UNO you have no 4K7 pullup resistors for the SDA and SCL lines.
As the MEGA does not have dedicated I2C either I would assume the same.
Place one 4K7 resistor between SDA and 5V.
Place one 4K7 resistor between SCL and 5V.
Tom..
1 Like
Wawa
December 9, 2022, 4:53am
11
I2C of a Mega is on pin 20, 21, not on pin A4, A5.
The Mega has built-in 10k pull up resistors.
The Uno only has software pull up (about 30k).
That should be fine for that distance, without adding external pull up.
Big question is, why two Arduinos.
Thinking you need two Arduinos is usually a beginner's mistake.
Leo..
As, I gather, the outputs of the I2C devices are open collector, pullup resistors of some sort would be essential.
Anyhow I digress, @pfusch22 in the picture with the Mega, does need to move to the Mega's I2C pins rather than A4 and A5.
We await with bated breath...
Tom...
Wawa
December 9, 2022, 10:33am
13
As said, there are.
A physical 10k and a software ~30k = 7.5k.
Leo..
I would suggest you read both the arduino and basic electronics cookbooks. Then watch some good tutorials on each.
system
Closed
June 8, 2023, 5:57am
15
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.