User Manual

The following example will cause channel 15 to start low, go high around 25% into the pulse (tick 1024 out of 4096),
transition back to low 75% into the pulse (tick 3072), and remain low for the last 25% of the pulse:
If you need to calculate pulse-width in microseconds, you can do that by first figuring out how long each cycle is. That
would be 1/freq where freq is the PWM frequency you set above. For 1000 Hz, that would be 1 millisecond. Then divide
by 4096 to get the time per tick, eg 1 millisecond / 4096 = ~0.25 microseconds. If you want a pulse that is 10
microseconds long, divide the time by time-per-tick (10us / 0.25 us = 40) then turn on at tick 0 and turn off at tick 40.
pwm.setPWM(15, 1024, 3072)
© Adafruit Industries https://learn.adafruit.com/adafruit-16-channel-pwm-servo-hat-for-raspberry-pi Page 20 of 28