-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
79 lines (60 loc) · 1.48 KB
/
test.py
File metadata and controls
79 lines (60 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from __future__ import print_function
from iobuzz.controllers.buzz_controller import BuzzController
import time
def on_key_down(controller, keys):
print("-------")
print("key down")
print (controller)
print (keys)
def on_key_up(controller, keys):
print("-------")
print("key up")
print (controller)
print (keys)
buzz = BuzzController()
buzz.register_on_key_down(on_key_down)
buzz.register_on_key_up(on_key_up)
print("Blink all")
buzz.blink_all()
time.sleep(3)
buzz.clear_animations()
print("Blink controllers 1 and 3")
buzz.blink_controllers([1, 3])
time.sleep(3)
buzz.clear_animations()
print("Turn on all")
buzz.turn_on_all()
time.sleep(3)
buzz.clear_animations()
print("Turn off all")
buzz.turn_off_all()
time.sleep(3)
buzz.clear_animations()
print("Turn on controllers 1 and 3")
buzz.turn_on_controllers([1, 3])
time.sleep(3)
buzz.clear_animations()
print("Turn on controllers 0 and 2")
buzz.turn_on_controllers([0, 2])
time.sleep(3)
buzz.clear_animations()
print("Turn off controllers 1 and 3")
buzz.turn_off_controllers([1, 3])
time.sleep(3)
buzz.clear_animations()
print("Turn off controllers 0 and 2")
buzz.turn_off_controllers([0, 2])
time.sleep(3)
buzz.clear_animations()
print("Do pairing animation")
buzz.do_pairing_animation()
time.sleep(3)
buzz.clear_animations()
print("Do search animation")
buzz.do_search_animation()
time.sleep(3)
buzz.clear_animations()
print("Do error animation")
buzz.do_error_animation()
time.sleep(3)
buzz.clear_animations()