I am trying to use an Adafruit PCA9685 servo driver module with an ELEGOO Mega 2560 board.
I am supplying the servo driver board with 5 V and tested all the wires to make sure. I tested the servo without the board and it works fine.
I2CScanner code:
#include "I2CScanner.h"
I2CScanner scanner;
void setup()
{
Serial.begin(9600);
while (!Serial) {};
scanner.Init();
}
void loop()
{
scanner.Scan();
delay(5000);
}
-
What exact board is this? Looks like an Arduino Due, in which case you would be using the wrong pins. Try to use the pins labeled "SCL" and "SDA".PMF– PMF2024年02月10日 16:08:53 +00:00Commented Feb 10, 2024 at 16:08
-
@PMF the exact board i am using is the elegoo mega 2560 and have put the pins in the "SCL" and "SDA" near the "AREF"Blaze48gamer– Blaze48gamer2024年02月10日 16:15:28 +00:00Commented Feb 10, 2024 at 16:15
-
1I'm not exactly sure about this board, but have you tried the other pins marked "SCL" and "SDA" (Pin 20/21 I think, near the green Led)PMF– PMF2024年02月10日 16:17:06 +00:00Commented Feb 10, 2024 at 16:17
-
@PMF It should be the exact same as the Arduino Mega 2560, I have tried those pins also the older version "A4" and "A5" pins but it still didn't detect anything. Thx for helping btw.Blaze48gamer– Blaze48gamer2024年02月10日 16:20:09 +00:00Commented Feb 10, 2024 at 16:20
-
what is the result when you run the code? ... please copy and paste into your post... no pictures pleasejsotola– jsotola2024年02月10日 19:05:52 +00:00Commented Feb 10, 2024 at 19:05
1 Answer 1
The I2C bus needs a set of pull up resistors. When buying assembled I2C devices, the designer may include I2C pull up resistors but not connect them. This is because, according to this sparkfun.com tutorial, you only need about 4.7K Ohms of pull up resistance. Adding multiple I2C boards to the same bus all with their own pull up resistors will lower this resistance and may damage I2C drivers. So, it is up to the end-user to decide which I2C board to connect the pull up resistors on.
-
1The breakout manufacturer (Adafruit in this case, I think) would write if that was necessary. But they explicitly state that it already has pullups.PMF– PMF2024年02月10日 16:15:00 +00:00Commented Feb 10, 2024 at 16:15