Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PWM Output on KC868-A8
#10
yes, if you don't use RF 433M module, you can use gpio2 for PWM output. here is arduino demo code for GPIO2 use for PWM.
Code:
const int pwmChannel = 0;
const int pwmFreq = 5000;
const int pwmResolution = 8;
const int gpioPin = 2;  // GPIO2

void setup() {
  // Configure the PWM channel
  ledcSetup(pwmChannel, pwmFreq, pwmResolution);
 
  // Attach GPIO2 to the PWM channel
  ledcAttachPin(gpioPin, pwmChannel);
}

void loop() {
  // Output a PWM signal with 50% duty cycle
  ledcWrite(pwmChannel, 128);  // 128 is 50% of 8-bit resolution
}
Reply


Messages In This Thread
PWM Output on KC868-A8 - by claudius - 05-29-2024, 07:41 AM
RE: PWM Output on KC868-A8 - by admin - 05-29-2024, 09:55 AM
RE: PWM Output on KC868-A8 - by claudius - 05-29-2024, 11:00 AM
RE: PWM Output on KC868-A8 - by admin - 05-29-2024, 11:12 AM
RE: PWM Output on KC868-A8 - by claudius - 06-03-2024, 05:35 PM
RE: PWM Output on KC868-A8 - by admin - 06-03-2024, 10:02 PM
RE: PWM Output on KC868-A8 - by claudius - 06-04-2024, 09:06 AM
RE: PWM Output on KC868-A8 - by EddyLee - 09-09-2024, 06:29 PM
RE: PWM Output on KC868-A8 - by EddyLee - 09-09-2024, 06:42 PM
RE: PWM Output on KC868-A8 - by admin - 09-09-2024, 11:12 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)