Qwiic Haptic Driver DA7280 Hookup Guide
Contributors:
bboyho, Elias The Sparkiest
Example 1: I2C Mode
We're just going to look the I2C_Mode.ino example. Open the File > Examples > SparkFun Qwiic Haptic Driver DA7280 Arduino Library > I2C_Mode. Select your board (in this case Arduino Uno) and COM port. Then hit the upload button.
Once uploaded, the Qwiic Haptic Driver should begin vibrating every half a second. Note that the value for hapDrive.setVibrate()
range from 0
to 127
. A value of 0
turns the motor off while a value of 127
turns the motor fully on. Try adjusting the value to a higher intensity. If the motor does not vibrate, try uncommenting the code to clear the interrupt.
Note: Make sure to disable the frequency tracking with
hapDrive.enableFreqTrack(false);
. Restricting the PCB (e.g. squeezing) raises an error which stops operation because it can not reach resonance.