====== Pwm ====== ''Output'' a PWM waveform on the specified ''channel''. ===== Syntax ===== from cubloc import Pwm PWM(pin: int, duty: int, period: int) ===== Parameters ===== * **pin**: GPIO pin number. * **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]]