adafruit / Adafruit_CircuitPython_seesaw

seesaw helper IC driver for circuitPython
MIT License
60 stars 35 forks source link

Fix `set_pwm_freq()` for ATtinys #125

Closed caternuson closed 10 months ago

caternuson commented 10 months ago

For #116 (got issue number wrong in PR fork name)

NOTE: The pwm_pins for attiny8x7 and attinyx16 have been set to include pins for both 8 bit PWM mode and 16 bit PWM mode (a more recent firmware feature). However, only one mode will actually be built into the firmware. There is currently no way to query this from the firmware so that pwm_pins could be adjusted at runtime.

Tested on an ATtiny816 seesaw breakout with this code:

import board
from adafruit_seesaw import seesaw
ss = seesaw.Seesaw(board.STEMMA_I2C())
ss.set_pwm_freq(11, 50)

BEFORE no output, so waiting forever to trigger before

AFTER expected output on pin 11 after