-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
105 lines (98 loc) · 2.63 KB
/
main.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
101
102
103
104
105
def on_button_pressed_a():
basic.show_leds("""
. . . . .
. # . # .
. . . . .
# . . . #
. # # # .
""")
for index in range(3):
music.play_melody("C D E F G A B C5 ", 407)
input.on_button_pressed(Button.A, on_button_pressed_a)
def on_sound_loud():
basic.show_leds("""
# # # # #
. . . # .
. . # . .
. # . . .
# # # # #
""")
music.play_melody("F G A F F G A F ", 120)
music.play_melody("A B C5 A B C5 - - ", 120)
input.on_sound(DetectedSound.LOUD, on_sound_loud)
def on_button_pressed_ab():
basic.show_leds("""
. . . . .
. # # # .
# # # # #
. # # # .
. . . . .
""")
music.play_melody("G D G D G D G D ", 281)
input.on_button_pressed(Button.AB, on_button_pressed_ab)
def on_button_pressed_b():
basic.show_leds("""
. . . . #
. . . # .
# . # . .
. # . . .
. . . . .
""")
music.play_sound_effect(music.create_sound_effect(WaveShape.SINE,
5000,
1,
255,
255,
500,
SoundExpressionEffect.WARBLE,
InterpolationCurve.LINEAR),
SoundExpressionPlayMode.IN_BACKGROUND)
input.on_button_pressed(Button.B, on_button_pressed_b)
def on_gesture_shake():
basic.show_string("SOS")
music.play_melody("C - C - C - - - ", 120)
music.play_melody("C C - C C - C C ", 120)
music.play_melody("- - C - C - C - ", 120)
input.on_gesture(Gesture.SHAKE, on_gesture_shake)
def on_logo_pressed():
basic.show_leds("""
# . # . #
. . # . .
# # # # #
. . # . .
# . # . #
""")
music.play_melody("G - G - A - F - ", 120)
music.play_melody("G - A - B - B - ", 120)
music.play_melody("C5 - B - A - G - ", 120)
input.on_logo_event(TouchButtonEvent.PRESSED, on_logo_pressed)
# Electronic Marrionette Of Technological Emotions
# https://stimulate.systems
basic.show_leds("""
. # . # .
. . . . .
. . # . .
. # . # .
# . . . #
""")
music.set_volume(255)
music.play_melody("E D C E D C G F ", 120)
basic.show_leds("""
. # . # .
. . . . .
# # # # #
. . . . .
. . . . .
""")
music.play_melody("E G F E C5 C5 B A ", 120)
basic.show_leds("""
. # . # .
. . . . .
. . # . .
. # . # .
# . . . #
""")
music.play_melody("C5 G G F E D C C ", 120)
def on_forever():
pass
basic.forever(on_forever)