Skip to content

Commit 5a0eb1e

Browse files
authored
Add functionality to set the RTP value
1 parent 2200f21 commit 5a0eb1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

adafruit_drv2605.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ def sequence(self) -> "_DRV2605_Sequence":
208208
"""
209209
return self._sequence
210210

211+
def set_realtime_value(self, val: int) -> None:
212+
"""Set the output value (amplitude) used for Real-Time Playback"""
213+
if not 0 <= val <= 255:
214+
raise ValueError("Real-Time Playback value must be a value within 0-255!")
215+
self._write_u8(_DRV2605_REG_RTPIN, val)
216+
211217
def set_waveform(self, effect_id: int, slot: int = 0) -> None:
212218
"""Select an effect waveform for the specified slot (default is slot 0,
213219
but up to 8 effects can be combined with slot values 0 to 7). See the

0 commit comments

Comments
 (0)