Skip to content

Commit 8c2960c

Browse files
authored
Merge branch 'main' into doc/typing-and-documentation
2 parents 5125400 + 32ae578 commit 8c2960c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

adafruit_drv2605.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def sequence(self) -> "_DRV2605_Sequence":
211211

212212
def set_waveform(self, effect_id: int, slot: int = 0) -> None:
213213
"""Select an effect waveform for the specified slot (default is slot 0,
214-
but up to 7 effects can be combined with slot values 0 to 6). See the
214+
but up to 8 effects can be combined with slot values 0 to 7). See the
215215
datasheet for a complete table of effect ID values and the associated
216216
waveform / effect.
217217
@@ -220,8 +220,8 @@ def set_waveform(self, effect_id: int, slot: int = 0) -> None:
220220
"""
221221
if not 0 <= effect_id <= 123:
222222
raise ValueError("Effect ID must be a value within 0-123!")
223-
if not 0 <= slot <= 6:
224-
raise ValueError("Slot must be a value within 0-6!")
223+
if not 0 <= slot <= 7:
224+
raise ValueError("Slot must be a value within 0-7!")
225225
self._write_u8(_DRV2605_REG_WAVESEQ1 + slot, effect_id)
226226

227227
# pylint: disable=invalid-name
@@ -316,7 +316,7 @@ def __init__(self, DRV2605_instance: DRV2605) -> None:
316316

317317
def __setitem__(self, slot: int, effect: Union[Effect, Pause]) -> None:
318318
"""Write an Effect or Pause to a slot."""
319-
if not 0 <= slot <= 6:
319+
if not 0 <= slot <= 7:
320320
raise IndexError("Slot must be a value within 0-6!")
321321
if not isinstance(effect, (Effect, Pause)):
322322
raise TypeError("Effect must be either an Effect() or Pause()!")
@@ -325,7 +325,7 @@ def __setitem__(self, slot: int, effect: Union[Effect, Pause]) -> None:
325325

326326
def __getitem__(self, slot: int) -> Union[Effect, Pause]:
327327
"""Read an effect ID from a slot. Returns either a Pause or Effect class."""
328-
if not 0 <= slot <= 6:
328+
if not 0 <= slot <= 7:
329329
raise IndexError("Slot must be a value within 0-6!")
330330
# pylint: disable=protected-access
331331
slot_contents = self._drv2605._read_u8(_DRV2605_REG_WAVESEQ1 + slot)
@@ -335,7 +335,7 @@ def __getitem__(self, slot: int) -> Union[Effect, Pause]:
335335

336336
def __iter__(self) -> Union[Effect, Pause]:
337337
"""Returns an iterator over the waveform sequence slots."""
338-
for slot in range(0, 7):
338+
for slot in range(0, 8):
339339
yield self[slot]
340340

341341
def __repr__(self) -> str:

0 commit comments

Comments
 (0)