forked from mjmccaffrey/marquee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modes.py
100 lines (96 loc) · 2.43 KB
/
modes.py
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""Custom operating modes."""
from sequences import *
def seq_center_alternate():
"""Alternate the top and bottom center lights."""
yield "0100000000"
yield "0000001000"
def mode_rhythmic_demo(do_sequence):
"""Perform a rhythmic demonstration."""
while True:
do_sequence(
seq_center_alternate,
count=2,
pace=0.8,
)
do_sequence(
seq_blink_alternate,
count=2,
pace=0.8,
)
do_sequence(
lambda: seq_move_halves(from_left=True),
count=1,
pace=0.4,
stop=4,
)
do_sequence(
lambda: seq_move_halves(from_left=False),
count=1,
pace=0.4,
stop=4,
)
do_sequence(
lambda: seq_build_halves(from_left=True),
count=1,
pace=0.4,
stop=4,
)
do_sequence(
lambda: seq_build_halves(from_left=False),
count=1,
pace=0.4,
stop=4,
)
do_sequence(
lambda: seq_build_rows_4("1", from_top=True),
count=4,
pace=0.2,
)
do_sequence(
lambda: seq_build_rows_4("1", from_top=False),
count=4,
pace=0.2,
)
do_sequence(
lambda: seq_rotate('1000000000', clockwise=True),
count=1,
pace=0.2,
stop=8,
)
do_sequence(
lambda: seq_rotate('0000000010', clockwise=False),
count=1,
pace=0.2,
stop=8,
)
do_sequence(
lambda: seq_rotate('0111111111', clockwise=True),
count=2,
pace=0.2,
stop=4,
)
do_sequence(
lambda: seq_rotate('1111111110', clockwise=False),
count=2,
pace=0.2,
stop=4,
)
do_sequence(
lambda: seq_rotate('1100000000', clockwise=True),
count=4,
pace=0.1,
stop=8,
)
do_sequence(
lambda: seq_rotate('1111111100', clockwise=False),
count=4,
pace=0.1,
stop=8,
)
do_sequence(
seq_rotate,
count=8,
pace=0.04,
)
do_sequence(seq_all_on, post_delay=6.4)
do_sequence(seq_all_off, post_delay=900)