File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 11# Simple demo of the DRV2605 haptic feedback motor driver.
2- # Will play all 117 effects in order for about a half second each.
2+ # Will play all 123 effects in order for about a half second each.
33# Author: Tony DiCola
44import time
55
1313i2c = busio .I2C (board .SCL , board .SDA )
1414drv = adafruit_drv2605 .DRV2605 (i2c )
1515
16- # Main loop runs forever trying each effect (1-117 ).
16+ # Main loop runs forever trying each effect (1-123 ).
1717# See table 11.2 in the datasheet for a list of all the effect names and IDs.
1818# http://www.ti.com/lit/ds/symlink/drv2605.pdf
1919effect_id = 1
2525 # slot number 0 to 6.
2626 # Optionally, you can assign a pause to a slot. E.g.
2727 # drv.sequence[1] = adafruit_drv2605.Pause(0.5) # Pause for half a second
28- drv .play () # Play the effect.
29- time .sleep (0.5 )
28+ drv .play () # play the effect
29+ time .sleep (0.5 ) # for 0.5 seconds
30+ drv .stop () # and then stop (if it's still running)
3031 # Increment effect ID and wrap back around to 1.
3132 effect_id += 1
32- if effect_id > 117 :
33+ if effect_id > 123 :
3334 effect_id = 1
You can’t perform that action at this time.
0 commit comments