Hello,
I want control several number of servos with using of some board to plug all together and include into assembly casing box. I think to get Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685
To control 2 servos I use pins 9 and 11 with sending of value (in my case with same names "9" and "11") from C# desktop application: myport.WriteLine("9"); myport.WriteLine(trackBar1.Value.ToString()); to loaded code:
Servo servo1;
Servo servo2;
int val;
void setup() {
Serial.begin(9600);
servo1.attach(9);
servo2.attach(11);
}
void loop() {
val = Serial.parseInt();
if(val == 9){
servo1.write(Serial.parseInt());
}
else if(val == 11){
servo2.write(Serial.parseInt());
}
}
If I follow this Connecting to the Arduino guide I have to connect 5V and GND from Arduino Uno or Due controller to the GND and VCC of Servo Driver, and Analog In 4 and 5 with SCL and SDA, and additionally I have to power driver separately with 5V and 2 Amp adapter I guess
I'm trying to figure out, if I'm not using pins with this board to control servos, what should be the code for similar separate control of multiple motors with 16-Channel 12-bit PWM/Servo Driver?
Any advice, guide or example would be helpful
