| Command | Arguments | Return Value | Operation |
|---|---|---|---|
PWMOFF(pin, POff) | uint8_t pinbool POff | void | Stops or re-enables PWM output on the specified pin. |
This example uses MPINO-16A8R8T PWM output D11 and digital input D22. HIGH on D22 stops PWM; LOW allows it again. This input demonstrates the function and does not replace an equipment emergency-stop device.
const uint8_t PWM_PIN = 11; void setup() { FDPWM(PWM_PIN, 1000, 50.0F); // Start 1 kHz PWM at 50% duty on D11. } void loop() { const bool stopRequest = digitalRead(22) == HIGH; PWMOFF(PWM_PIN, stopRequest); // Stop or allow D11 PWM according to D22. if (!stopRequest) FDPWM(PWM_PIN, 1000, 50.0F); // Apply PWM settings again after allowing the output. delay(20); }