File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
# 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.
3
3
# Author: Tony DiCola
4
4
import time
5
5
13
13
i2c = busio .I2C (board .SCL , board .SDA )
14
14
drv = adafruit_drv2605 .DRV2605 (i2c )
15
15
16
- # Main loop runs forever trying each effect (1-117 ).
16
+ # Main loop runs forever trying each effect (1-123 ).
17
17
# See table 11.2 in the datasheet for a list of all the effect names and IDs.
18
18
# http://www.ti.com/lit/ds/symlink/drv2605.pdf
19
19
effect_id = 1
25
25
# slot number 0 to 6.
26
26
# Optionally, you can assign a pause to a slot. E.g.
27
27
# 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)
30
31
# Increment effect ID and wrap back around to 1.
31
32
effect_id += 1
32
- if effect_id > 117 :
33
+ if effect_id > 123 :
33
34
effect_id = 1
You can’t perform that action at this time.
0 commit comments