Hi, I'm a new learner of Arduino and am trying to program multiple servos using the PCA9685. When I just had one servo to deal with that was directly connected to the Arduino, I could use the Servo library, but now I would have also to use the Wire Library. I'm not sure how I should do this, and the other PCA9685 libraries I have tried that seem to work for others do not work for me. I was thinking of using the Wire Library's .write() to write the Servo Library's .write() so that the servo would move at the specified channel on the specified address. Again, I am very new to this so I don't have much code other than my theories.
Always show us a good schematic of your proposed circuit.
Show us good images of your ‘actual’ wiring.
Give links to components.
Tell us detail. Which did you try, and what does "do not work" mean - no motion? Won't compile? ????
Welcome to the forum
How many servos do you need to control and which Arduino board are you using ?
PWM boardServoArduino Uno
I don't have a picture of the circuit, but I followed what I could online, with the GND to GND pin, the V+ to 5V pin, the SDA to A4, and the SDL to A5.
Sorry for the vagueness, the servo was not moving. I tried using the PCA9685_RT library by RobTillaart and the PCA9685 library by NachtRaveVL. There were no compilation errors.
I am trying to control one servo for now(at channel 0), but am planning to move onto a full board and then multiple by daisy-chaining.
You will need an external power supply for even one servo, they take a lot of current when they move.
How is the servo wired up to the PCA9685?
What code are you using to drive the servos?
What address is the PCA9685 on the I2C bus? Are you using that in your code? Have you set the PCA9685 address links on the PCA9685 to match what you are using in software?
You need to read this
and the subsequent pages.
I have the external power supply also plugged into the PCA9685. The servo is wired up properly to the PCA9685 with the PWM pin on the top, followed by the voltage and the gnd pins. I am currently looking for guidance with the coding of the servos to make them move, and don't have anything right now. I am pretty sure that the address I am using for the PCA9685 is correct and am using it for the Wire functions. What do you mean by matching the PCA9685 address links on the PCA9685?
From memory the PCA9685 has solder pads that allow you to change its address by shorting them
Correct.
You can't get code to work unless you have working hardware. You do want to solve this problem do you.
So far you are not cooperating, everything we suggest is just rejected seemingly out of hand.
Basically you present something that should not be a problem, there is no reason why it shouldn't work, so we are exploring any possible reason for this.
Things like this
Go totally unanswered.
We only can know what you tell us, and you have been quite stingy with what you will tell us so far.
Here is the best picture I have of the hardware. I'm sorry if I'm not clear in what I'm saying because as I already mentioned, I'm new to this and am trying to do my best to give information to the helpers.
In the image, the external power is connected through wires that are connected to a supply directed from an outlet. The Arduino Uno is connected to the computer. In addition to this, when I was looking for the address of the PCA9685, I found that I was getting two results of 0x40 and 0x80. I'm not sure which one is correct or why this is happening, and I was using the example provided by the Wire Library to find an I2C address.
The picture is not clear enough to show the connections between the Uno and the control board
Please draw the circuit using pencil and paper with the pins used on both boards labelled clearly, photograph it and post it here
That is because the PCA9685 has a "universal" register at 0x80, when you change things in that it changes things in all the PCA9685's connected to the I2C bus at different addresses. These are set by the solder links at the top right hand corner of the breakout board.
If you don't want to use this feature you don't have to, if you only have one PCA9685 then there is no need to.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.