Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino source code for KC868-AIO]-07 PWM_ALL_ON AND OFF
#1
[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);

   
}


Attached Files
.zip   KC868-AIO-PWM_ALL_ON_OFF.zip (Size: 687 bytes / Downloads: 285)
Reply
#2
(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


Attached Files Image(s)
   
Reply
#3
you can use this arduino library: 
.zip   PCA9685_16-Channel_PWM_Driver_Module_Library.zip (Size: 349.64 KB / Downloads: 44)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)