Qwiic Haptic Driver DA7280 Hookup Guide

Pages
Contributors: bboyho, Elias The Sparkiest
Favorited Favorite 1

Example 2: PWM Mode

We're just going to look the PWM_Mode_Timer1.ino example. Open the File > Examples > SparkFun Qwiic Haptic Driver DA7280 Arduino Library > PWM_Mode_Timer1.ino. Select your board (in this case Arduino Uno) and COM port. Then hit the upload button.

Once uploaded, the Qwiic Haptic Driver will first clear a flag that shuts the motor off if the PWM signal is cut off suddenly without being set into inactive mode. The motor will begin vibrating based on the PWM signal in the for loop. In this case, the PWM signal is dependent on the value for power and we slowly increase the intensity.