@@ -191,19 +191,18 @@ def library(self, val: int) -> None:
191
191
@property
192
192
def sequence (self ) -> "_DRV2605_Sequence" :
193
193
"""List-like sequence of waveform effects.
194
- Get or set an effect waveform for slot 0-6 by indexing the sequence
194
+ Get or set an effect waveform for slot 0-7 by indexing the sequence
195
195
property with the slot number. A slot must be set to either an :class:`~Effect`
196
196
or :class:`~Pause` class. See the datasheet for a complete table of effect ID
197
197
values and the associated waveform / effect.
198
198
199
199
E.g.:
200
+
200
201
.. code-block:: python
201
202
202
203
# Getting the effect stored in a slot
203
204
slot_0_effect = drv.sequence[0]
204
205
205
- .. code-block:: python
206
-
207
206
# Setting an Effect in the first sequence slot
208
207
drv.sequence[0] = Effect(88)
209
208
"""
@@ -317,16 +316,16 @@ def __init__(self, DRV2605_instance: DRV2605) -> None:
317
316
def __setitem__ (self , slot : int , effect : Union [Effect , Pause ]) -> None :
318
317
"""Write an Effect or Pause to a slot."""
319
318
if not 0 <= slot <= 7 :
320
- raise IndexError ("Slot must be a value within 0-6 !" )
319
+ raise IndexError ("Slot must be a value within 0-7 !" )
321
320
if not isinstance (effect , (Effect , Pause )):
322
- raise TypeError ("Effect must be either an Effect() or Pause() !" )
321
+ raise TypeError ("Effect must be either an Effect or Pause!" )
323
322
# pylint: disable=protected-access
324
323
self ._drv2605 ._write_u8 (_DRV2605_REG_WAVESEQ1 + slot , effect .raw_value )
325
324
326
325
def __getitem__ (self , slot : int ) -> Union [Effect , Pause ]:
327
326
"""Read an effect ID from a slot. Returns either a Pause or Effect class."""
328
327
if not 0 <= slot <= 7 :
329
- raise IndexError ("Slot must be a value within 0-6 !" )
328
+ raise IndexError ("Slot must be a value within 0-7 !" )
330
329
# pylint: disable=protected-access
331
330
slot_contents = self ._drv2605 ._read_u8 (_DRV2605_REG_WAVESEQ1 + slot )
332
331
if slot_contents & 0x80 :
0 commit comments