I'm doing a project which requires 16 5v dc motors to be driven in PWM. So I have brought this board -
https://www.amazon.com/16-Channel-12-bit-Servo-Driver-Interface/dp/B00EIB0U7A I'm using the #include <Adafruit_PWMServoDriver.h> library
My understanding was pwm.setPWM(0, 1, 4095) being setPWM(channel, on, off) will turn on pin 0 for most of the time and I will be getting around 100% of VCC. But I'm getting only around 1.5v from the PWM pin.
I need voltage in the range of 3v to 5v from the PWM pins for my motors. So now I am wondering what I am doing wrong and is it possible to get 100% of vcc from the PWM pins using the PCA9865 board?
This is my Arduino code :
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// you can also call it with a different address you want
//Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
#if defined(ARDUINO_ARCH_SAMD)
// for Zero, the output on USB Serial console, remove the line below if using programming port to program the Zero!
#define Serial SerialUSB
#endif
void setup() {
#ifdef ESP8266
Wire.pins(2, 14); // ESP8266 can use any two pins, such as SDA to #2 and SCL to #14
#endif
Serial.begin(9600);
Serial.println("16 channel PWM test!");
pwm.begin();
pwm.setPWMFreq(1000); // This is the maximum PWM frequency
#ifdef TWBR
// save I2C bitrate
uint8_t twbrbackup = TWBR;
// must be changed after calling Wire.begin() (inside pwm.begin())
TWBR = 12; // upgrade to 400KHz!
#endif
}
void loop() {
pwm.setPWM(0, 1, 4095);
}
Cheers