Datasheet
library bundle for both express and non-express boards.
Remember for non-express boards like the, you'll need to manually install the necessary libraries from the bundle:
adafruit_drv2605.mpy
adafruit_bus_device
You can also download the adafruit_drv2605.mpy from its releases page on Github.
Before continuing make sure your board's lib folder or root filesystem has
the adafruit_drv2605.mpy, and adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL so you are at the CircuitPython >>> prompt.
Usage
To demonstrate the usage of the board we'll initialize it and vibrate the motor using effects built-in to the DRV2605
chip. First run the following code to import the necessary modules and initialize the I2C connection with the controller:
Remember if you're using a board that doesn't support hardware I2C (like the ESP8266) you need to use
the bitbangio module instead:
Now you're ready to start vibrating the motor with different built-in effects. First you need to choose an effect to play
based on its ID number. See table 11.2 in the datasheet for a list of all the effects, but for example a strong click with
effect ID #1 would be:
Simply call the set_waveform function and pass the effect ID number of the desired effect (a value from 1 to 123). For
reference here's a quick snapshot of the effects from table 11.2 of the datasheet:
import board
import busio
import adafruit_drv2605
i2c = busio.I2C(board.SCL, board.SDA)
drv = adafruit_drv2605.DRV2605(i2c)
import board
import bitbangio
import adafruit_drv2605
i2c = bitbangio.I2C(board.SCL, board.SDA)
drv = adafruit_drv2605.DRV2605(i2c)
drv.set_waveform(1)
© Adafruit Industries https://learn.adafruit.com/adafruit-drv2605-haptic-controller-breakout Page 17 of 23










