Haptic Motor Driver Hook-Up Guide
Using the SparFun DRV2605L Library
To use the SparkFun Haptic Motor Driver, you will need some supporting software. If you use Arduino, then you are in luck! We created an Arduino Library that makes the DRV2605L easy to use. To automatically install the library from the Arduino IDE simply navigate to Sketch > Include Library > Manage Libraries... and search for SparkFun Haptic Motor Driver. Or you can grap the zip here from the GitHub repository to manually install:
The SparkFun DRV2605L library has every register defined, and simple functions can be called to create a custom haptic experience. Every register must be set (or use the default if that works for you). Use the datasheet to help you with the values that need to be written to the registers.
Going through the library header file, you'll see just about every register has a comment with its function and corresponding page number in the data sheet. This board is capable of operating in seven modes and can use either an LRA or ERM type motors. We will explore 2 of the modes -- Internal Trigger mode, and PWM mode. From here it shouldn't take much to get the device working in other modes.
Let's explore each example in detail.