====== Pwm ====== ''Output'' a PWM waveform on the specified ''channel''. ===== Syntax ===== from cubloc import Pwm Pwm(channel: int, duty: int, period: int) ===== Parameters ===== * **channel**: PWM ''channel'' number. This hardware supports channels 0 through 9. * **duty**: ''duty'' count, where 0 <= ''duty'' < ''period''. * **period**: PWM ''period'' count (1 to 65535). ===== Exceptions ===== * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: An argument is not an integer. * [[https://docs.micropython.org/en/latest/library/builtins.html#ValueError|ValueError]]: ''channel'', ''duty'', or ''period'' is out of range. ===== Example ===== from cubloc import Pwm # Example usage Pwm(0, 1, 1) ===== Related APIs ===== * [[logicpython:cubloc_api:pwmoff|PwmOff]]