Skip to content

Commit 6474230

Browse files
committed
fix typo and make 'default' use the native pin names going forward
1 parent aadb8ac commit 6474230

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

adafruit_seesaw/seesaw.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def __init__(self, i2c_bus, addr=0x49, drdy=None, reset=True):
170170

171171
self.pin_mapping = MM1_Pinmap
172172
elif (pid in (_5690_PID, _5681_PID, _5743_PID)) or (self.chip_id in
173-
(_ATTINY817_HW_ID_CODE,
174-
_ATTINY807_HW_ID_CODE,
175-
_ATTINY1617_HW_ID_CODE)):
173+
(_ATTINY816_HW_ID_CODE,
174+
_ATTINY806_HW_ID_CODE,
175+
_ATTINY1616_HW_ID_CODE)):
176176
from adafruit_seesaw.attinyx16 import ATtinyx16_Pinmap
177177

178178
self.pin_mapping = ATtinyx16_Pinmap
@@ -265,10 +265,10 @@ def analog_read(self, pin, delay=0.008):
265265
if pin not in self.pin_mapping.analog_pins:
266266
raise ValueError("Invalid ADC pin")
267267

268-
if self.chip_id == _ATTINY8X7_HW_ID_CODE:
269-
offset = pin
270-
elif self.chip_id == _SAMD09_HW_ID_CODE:
268+
self.chip_id == _SAMD09_HW_ID_CODE:
271269
offset = self.pin_mapping.analog_pins.index(pin)
270+
else:
271+
offset = pin
272272

273273
self.read(_ADC_BASE, _ADC_CHANNEL_OFFSET + offset, buf, delay)
274274
ret = struct.unpack(">H", buf)[0]
@@ -361,10 +361,10 @@ def analog_write(self, pin, value):
361361
if pin not in self.pin_mapping.pwm_pins:
362362
raise ValueError("Invalid PWM pin")
363363

364-
if self.chip_id == _ATTINY8X7_HW_ID_CODE:
365-
offset = pin
366-
elif self.chip_id == _SAMD09_HW_ID_CODE:
364+
if self.chip_id == _SAMD09_HW_ID_CODE:
367365
offset = self.pin_mapping.pwm_pins.index(pin)
366+
else:
367+
offset = pin
368368

369369
if self.pin_mapping.pwm_width == 16:
370370
cmd = bytearray([offset, (value >> 8), value & 0xFF])

0 commit comments

Comments
 (0)