====== FDPWM() ====== ''FDPWM()'' outputs PWM at the specified frequency and duty cycle. {{:en-us_commands:reference:fdpwm.svg?900|FDPWM command operation flow}} ''void FDPWM(uint8_t pin, int32_t intHz, float Duty)'' ===== Commands ===== ^ Command ^ Arguments ^ Return Value ^ Operation ^ | ''FDPWM(pin, intHz, Duty)'' | ''uint8_t pin''\\ ''int32_t intHz''\\ ''float Duty'' | ''void'' | Outputs PWM at the specified frequency and duty cycle. | ===== Example ===== void setup() { // K channels 0~2 share Timer3. FDPWM(0, 1000, 25.0F); // Output PWM at the specified frequency and duty cycle. FDPWM(1, 1000, 50.0F); // Output PWM at the specified frequency and duty cycle. FDPWM(2, 1000, 75.0F); // Output PWM at the specified frequency and duty cycle. // K channels 3~5 share Timer4. FDPWM(3, 500, 25.0F); // Output PWM at the specified frequency and duty cycle. FDPWM(4, 500, 50.0F); // Output PWM at the specified frequency and duty cycle. FDPWM(5, 500, 75.0F); // Output PWM at the specified frequency and duty cycle. } void loop() { } ===== Precautions ===== * Check product-specific PWM pins and timer sharing. * Changing frequency or resolution may also affect other channels on the same timer. * Ensure the connected load is safe when stopping or resetting outputs. ===== Built-in Commands in the Same Category ===== * [[:en-us_commands:reference:pwm|PWM() View detailed description]] * [[:en-us_commands:reference:pwmoff|PWMOFF() View detailed description]] * [[:en-us_commands:reference:pwm_reset|PWM_RESET() View detailed description]] [[:en-us_commands:builtin|← Built-in Command List]]