I have written this MATLAB script for DRV2605L Haptic Motor Driver according to protocol documented in Texas Instruments DRV2605L datasheet.
I used Sparkfun DRV2605L Breakout Board HERE
For more info you can check out HERE
You can edit the parameters according to motor type, target frequency and immersion haptic library.
You should run ArduinoSystem.m as the main file. The script initial check for all connected devices. The script is designed to scan a I2C multiplexer (TCA9458A), an IMU (BNO055) and 8 DRV2605L ICs.
After the scan is done, the script initiates a test haptic feedback for all connected DRV2605Ls
In order to successfully control the DRV2605L IC you should initiate the scripts in the following order.
This initiates the DRV2605L and checks for power and temperature protection flags Here you have to configure and auto-calibrate the DRV2605L according to your setup. You can find more information at DRV2605L datasheet. Immersion provides individual libraries for ERM and LRA actuators. There are different trigger methods for DRV2605L, here we use the internal software trigger for haptic effects. The desired haptic effect from the Immersion library is selected At this stage, you can run the "go script" as much as you want as you have configured the DRV2605L. It fires up the selected haptic effect The code is a work-in-progress. Use at your discretion. tcascanner.ino Arduino code belongs to Todd E. Kurt