adafruit-beaglebone-io-python/source/examples/python/pwm.old.py
2017-07-28 17:55:42 -04:00

14 lines
310 B
Python

import Adafruit_BBIO.PWM as PWM
#set polarity to 1 on start:
#PWM.start("P9_14", 50, 2000, 1)
#PWM.start(channel, duty, freq=2000, polarity=0)
#duty values are valid 0 (off) to 100 (on)
PWM.start("P9_14", 50)
PWM.set_duty_cycle("P9_14", 25.5)
PWM.set_frequency("P9_14", 10)
PWM.stop("P9_14")
PWM.cleanup()