03-23-2023, 01:24 AM
(This post was last modified: 03-23-2023, 01:30 AM by KinCony Support.)
[Arduino source code for KC868-AIO]-07 PWM_ALL_ON AND OFF
Code:
/* KC868-AIO_PWM OUTPUT AO_O01----AO_O016*/
#include "PCA9685.h"
PCA9685 pwmController;
void setup() {
Serial.begin(115200);
Wire.begin(4,16);
pwmController.resetDevices();
pwmController.init();
}
void loop() {
pwmController.setPWMFrequency(100);
for(int j=0;j<=15;j++){
pwmController.setChannelPWM(j, 0);
Serial.println(pwmController.getChannelPWM(j));
}
delay(1000);
for(int j=0;j<=15;j++){
pwmController.setChannelPWM(j, 4096);
Serial.println(pwmController.getChannelPWM(j));
}
delay(3000);
}