en-us_commands:reference:pwmoff
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:pwmoff [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1 | en-us_commands:reference:pwmoff [2026/09/14 20:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== Example ===== | ===== Example ===== | ||
| + | |||
| + | 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. | ||
| <code cpp> | <code cpp> | ||
| - | PWMOFF(21, true); | + | const uint8_t PWM_PIN = 11; |
| + | |||
| + | void setup() { | ||
| + | FDPWM(PWM_PIN, | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | const bool stopRequest = digitalRead(22) == HIGH; | ||
| + | | ||
| + | if (!stopRequest) FDPWM(PWM_PIN, | ||
| + | delay(20); | ||
| + | } | ||
| </ | </ | ||
| Line 24: | Line 37: | ||
| * Changing frequency or resolution may also affect other channels on the same timer. | * Changing frequency or resolution may also affect other channels on the same timer. | ||
| * Ensure the connected load is safe when stopping or resetting outputs. | * Ensure the connected load is safe when stopping or resetting outputs. | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/pwmoff.1788785569.txt.gz · Last modified: by 127.0.0.1
