forked from Lord-Awesome/Chris_Code_Database
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimultaneous_hue_shift.py
More file actions
29 lines (29 loc) · 1.12 KB
/
simultaneous_hue_shift.py
File metadata and controls
29 lines (29 loc) · 1.12 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
def simultaneous_hue_shift(wait, speed):
for i in range(math.floor(256/speed)):
color = Adafruit_WS2801.RGB_to_color(0, 255, math.floor(i*speed))
for j in range(pixels.count()):
pixels.set_pixel(j, color)
pixels.show()
if wait > 0:
time.sleep(wait)
for i in range(math.floor(256/speed)):
color = Adafruit_WS2801.RGB_to_color(0, 255-math.floor(i*speed), 255)
for j in range(pixels.count()):
pixels.set_pixel(j,color)
pixels.show()
if wait > 0:
time.sleep(wait)
for i in range(math.floor(256/speed)):
color = Adafruit_WS2801.RGB_to_color(math.floor(i*speed), 0, 255)
for j in range(pixels.count()):
pixels.set_pixel(j,color)
pixels.show()
if wait > 0:
time.sleep(wait)
for i in range(math.floor(256/speed)):
color = Adafruit_WS2801.RGB_to_color(255, 0, 255-math.floor(i*speed))
for j in range(pixels.count()):
pixels.set_pixel(j,color)
pixels.show()
if wait > 0:
time.sleep(wait)