Datasheet
when the play function is called. Simply provide the slot number as an optional keyword argument to set_waveform
(the default if not specified is slot 0).
For example try running:
This will build a compound effect from two waveforms:
Effect #84 (ramp up, medium smooth) in slot 0, the default slot.
Effect #1 (strong click) in slot 1
Notice how slot #2 is set to a value of zero. This tells the chip to stop adding compound effects after slot 1. You can
add more effects in other slots up to a value of slot #6.
Finally it's uncommon but you might want to switch between using a linear resonance actuator motor or eccentric
rotating mass motor. The small flat pancake motors like sold in the Adafruit shop are ERM motors and the library
defaults to their usage. However you can call the use_LRM function to switch to configure the chip to use a LRM style
motor:
You can also switch back to using an ERM style motor (the default) with the use_ERM function:
That's all there is to using the DRV2605 with CircuitPython! Happy motoring!
Here's a complete example of using the board to play the 117 first effects for a half second each. Save this as main.py
on your board and watch the REPL output to see the effect ID printed as it plays on the motor. Remember to switch to
the bitbangio module if necessary for your board!
drv.set_waveform(84) # Effect 84 in slot 0
drv.set_waveform(1, slot=1) # Effect 1 in slot 1
drv.set_waveform(0, slot=2) # End effects after slot 1 (set slot 2 to 0)
drv.play()
drv.use_LRM()
drv.use_ERM()
© Adafruit Industries https://learn.adafruit.com/adafruit-drv2605-haptic-controller-breakout Page 19 of 23










