def setFrequency(self, freq): io.pwmFrequency(self.pin, freq)
def __init__(self, pin): self.pin = pin io.pwmEnable(pin) # Init the Pin to PWM mode io.pwmFrequency(pin, 20000) # Set a frequency, not important for now self.setPower(0.0)