@@ -170,9 +170,9 @@ def __init__(self, i2c_bus, addr=0x49, drdy=None, reset=True):
170
170
171
171
self .pin_mapping = MM1_Pinmap
172
172
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 )):
176
176
from adafruit_seesaw .attinyx16 import ATtinyx16_Pinmap
177
177
178
178
self .pin_mapping = ATtinyx16_Pinmap
@@ -265,10 +265,10 @@ def analog_read(self, pin, delay=0.008):
265
265
if pin not in self .pin_mapping .analog_pins :
266
266
raise ValueError ("Invalid ADC pin" )
267
267
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 :
271
269
offset = self .pin_mapping .analog_pins .index (pin )
270
+ else :
271
+ offset = pin
272
272
273
273
self .read (_ADC_BASE , _ADC_CHANNEL_OFFSET + offset , buf , delay )
274
274
ret = struct .unpack (">H" , buf )[0 ]
@@ -361,10 +361,10 @@ def analog_write(self, pin, value):
361
361
if pin not in self .pin_mapping .pwm_pins :
362
362
raise ValueError ("Invalid PWM pin" )
363
363
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 :
367
365
offset = self .pin_mapping .pwm_pins .index (pin )
366
+ else :
367
+ offset = pin
368
368
369
369
if self .pin_mapping .pwm_width == 16 :
370
370
cmd = bytearray ([offset , (value >> 8 ), value & 0xFF ])
0 commit comments