Skip to content

Commit cf57c80

Browse files
Update some animations to 48 lights
1 parent d365095 commit cf57c80

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

animations/cylon/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
while True:
1313
pix = []
1414
alive = 0
15-
if n == 3:
15+
if n == 5:
1616
direction = -1
1717
elif n == 0:
1818
direction = 1
19-
for i in xrange(6):
20-
for j in xrange(4):
19+
for i in xrange(8):
20+
for j in xrange(6):
2121
if j == n:
2222
pix.append((1023.0,0.0,0.0))
2323
else:

animations/light-dance/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
if __name__ == "__main__":
77
import time
88
out = ColorsOut()
9-
pix = [(0.0,0.0,0.0)] * 24
9+
pix = [(0.0,0.0,0.0)] * 48
1010
fallRate = 7.0
1111
sleepTimer = 0.02
1212
frameMax = 40
1313
frames = 0
14-
for i in xrange(24):
14+
for i in xrange(48):
1515
pix[i] = (0.0 , 0.0, 0.0)
1616

1717
while True:
1818
if frames < 0:
19-
pix[random.randint(0, 23.0)] = (1023.0, 1023.0, 1023.0)
19+
pix[random.randint(0, 47.0)] = (1023.0, 1023.0, 1023.0)
2020
frames = random.randint(0, frameMax)
2121

2222
else:
2323
frames = frames - 1
2424

2525
out.write(pix)
2626

27-
for i in xrange(24):
27+
for i in xrange(48):
2828
pix[i] = (pix[i][0] - fallRate, pix[i][1] - fallRate, pix[i][2] - fallRate)
2929

30-
time.sleep(sleepTimer)
30+
time.sleep(sleepTimer)

animations/pong/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def check_speed(curr, speed, end): #Helper function that keeps the ball in bound
3535
x_vals = Queue(maxsize=tailsize)
3636
y_vals = Queue(maxsize=tailsize)
3737
out = FadeAnimation() #Set up the fade animation
38-
out.FADERATE = 1.0
38+
out.FADERATE = 5.0
3939
out.start()
4040

4141
for i in range(MAX_X * MAX_Y):

animations/rain-hues/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from oscapi import ColorsOut
77
from animations import FadeAnimation
88

9-
MAX_BULBS = 24
9+
MAX_BULBS = 48
1010

1111
fps = 60.0
1212

animations/random/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@
1919
if __name__ == "__main__":
2020
import time
2121
out = ColorsOut()
22-
pix_A = [(0.0,0.0,0.0)]*24
23-
pix_B = [(0.0,0.0,0.0)]*24
22+
pix_A = [(0.0,0.0,0.0)]*48
23+
pix_B = [(0.0,0.0,0.0)]*48
2424
while True:
2525
pix_A = pix_B[:]
26-
for i in range(24):
26+
for i in range(48):
2727
while pix_B[i] == pix_A[i]:
2828
pix_B[i] = random.choice(nice_pixels)
2929

30-
pix = [(0.0,0.0,0.0)]*24
30+
pix = [(0.0,0.0,0.0)]*48
3131
for i in range(int(real_steps+1)):
3232
d = float(i)/float(real_steps)
3333
d = math.sin(d * math.pi * 0.5)
3434
dp = 1-d
35-
for j in range(24):
35+
for j in range(48):
3636
(r1,g1,b1) = pix_A[j]
3737
(r2,g2,b2) = pix_B[j]
3838
pix[j] = (r1*dp + r2*d, g1*dp + g2*d, b1*dp + b2*d)

animations/refridgerator/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@
88
if __name__ == "__main__":
99
import time
1010
out = ColorsOut()
11-
pix = [(0.0,0.0,0.0)] * 24
11+
pix = [(0.0,0.0,0.0)] * 48
1212
runInAnimation = True
1313
smoothnessRatio = 110
1414
sleepTime = .01
1515
while True:
1616
if runInAnimation:
1717
for i in xrange(12):
18-
pix[random.randint(0,23)] = (0.0, 0.0, pix[i][2] + 1023/smoothnessRatio)
18+
pix[random.randint(0,47)] = (0.0, 0.0, pix[i][2] + 1023/smoothnessRatio)
1919
out.write(pix)
2020
if pix[i][2] > 900:
2121
runInAnimation = False
2222
time.sleep(sleepTime)
2323
else:
2424
for i in xrange(12):
25-
pix[random.randint(0,23)] = (0.0, 0.0, pix[i][2] - 1023/smoothnessRatio)
25+
pix[random.randint(0,47)] = (0.0, 0.0, pix[i][2] - 1023/smoothnessRatio)
2626
out.write(pix)
2727
if pix[i][2] < 100.0:
2828
runInAnimation = True
29-
time.sleep(sleepTime)
29+
time.sleep(sleepTime)

animations/spin/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
out.FADERATE = 32.0
1010
out.start()
1111

12-
pix = [(1023.0,1023.0,1023.0)]*24
13-
path = [0,1,2,3,7,11,15,14,13,12,8,4]
12+
pix = [(1023.0,1023.0,1023.0)]*48
13+
path = [0,1,2,3,4,5,11,17,23,29,35,41,47,46,45,44,43,42,36,30,24,18,12,6]
1414

1515
sleeptime = 0.02
1616

animations/white/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
#g = 255.0
1313
#b = 70.0
1414
while True:
15-
pix = [(4.0 * r, 4.0 * g, 4.0 * b)] * 24
15+
pix = [(4.0 * r, 4.0 * g, 4.0 * b)] * 48
1616
out.write(pix)
1717
time.sleep(0.2)

0 commit comments

Comments
 (0)