-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (30 loc) · 1.05 KB
/
main.py
File metadata and controls
36 lines (30 loc) · 1.05 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
# Press Button A to decrease the brightness of the HDHalo LEDs.
def on_button_pressed_a():
global brightness
if brightness > 0:
brightness += -1
haloDisplay.set_brightness(brightness)
input.on_button_pressed(Button.A, on_button_pressed_a)
# Press Buttons A and B to display the brightness of the HDHalo LEDs.
def on_button_pressed_ab():
basic.show_string("Brightness:")
basic.show_number(brightness)
input.on_button_pressed(Button.AB, on_button_pressed_ab)
# Press Button B to increase the brightness of the HDHalo LEDs.
def on_button_pressed_b():
global brightness
if brightness < 255:
brightness += 1
haloDisplay.set_brightness(brightness)
input.on_button_pressed(Button.B, on_button_pressed_b)
brightness = 0
haloDisplay: kitronik_halo_hd.ZIPHaloHd = None
haloDisplay = kitronik_halo_hd.create_zip_halo_display(60)
brightness = 113
haloDisplay.clear()
haloDisplay.set_brightness(brightness)
haloDisplay.show_rainbow(1, 360)
while True:
haloDisplay.rotate(1)
haloDisplay.show()
basic.pause(1000)