PCA9865 Arduino Uno
GND GND
SCL SCL
SDA SDA
VCC 5V
Am using one servo motor so connected to 5v pin of arduino to vcc.
Code i used from arduino examples:
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40);
#define SERVOMIN 0 // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX 600 // this is the 'maximum' pulse length count (out of 4096)
// our servo # counter
uint8_t servonum = 0;
void setup() {
Serial.begin(9600);
Serial.println("16 channel Servo test!");
Serial.print("servo number ");
Serial.print(servonum);
pwm.begin();
pwm.setPWMFreq(50); // Analog servos run at ~60 Hz updates
yield();
}
void loop() {
// Drive each servo one at a time
//Serial.println(servonum);
if(servonum == 0) {
Serial.println(servonum);
for (uint16_t pulselen = SERVOMIN; pulselen < SERVOMAX; pulselen++) {
pwm.setPWM(servonum, 0, pulselen);
Serial.println(pwm.getPWM(0));
}
delay(500);
servonum ++;
if (servonum > 0) servonum = 1;
}
}
After setting PWM i tried printing by getpwm(0) , result is o at all points.
21:25:33.277 -> 0
KIndly suggest.. is there problem with board?
Servo works fine since i tried connecting directly with arduino with servo library and rotating fine.