User Tools

Site Tools


en-us_commands:reference:pwmoff

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en-us_commands:reference:pwmoff [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1en-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(21true);+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_PINstopRequest);  // 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); 
 +}
 </code> </code>
  
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:pwm|PWM() View detailed description]]
 +  * [[:en-us_commands:reference:fdpwm|FDPWM() View detailed description]]
 +  * [[:en-us_commands:reference:pwm_reset|PWM_RESET() View detailed description]]
  
 [[:en-us_commands:builtin|← Built-in Command List]] [[:en-us_commands:builtin|← Built-in Command List]]
  
en-us_commands/reference/pwmoff.1788785569.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki