Smart Home Automation Forum

Full Version: [Arduino source code for KC868-AIO]-07 PWM_ALL_ON AND OFF
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[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);

   
}
(03-23-2023, 01:24 AM)KinCony Support Wrote: [ -> ][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);

   
}

Hello dear.. I tried to apply this lesson, but unfortunately this error appears.. The same library was used
you can use this arduino library: [attachment=5237]