-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfading.py
47 lines (35 loc) · 1.06 KB
/
fading.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
from artdmx import ArtNet, ArtDMX
from scapy.all import *
from itertools import chain
from time import sleep
from haxosender import Sender
from random import randrange
universe = [ 255,172,0, 255,172,0, 255,172,0, 255,172,0 ]
"""
begin met strobe
donder
wind
lightning
mist
vertrekken
"""
if __name__ == "__main__":
bars = Sender('31.22.122.55')
universe = [[12, 255, 0,
125, 200, 125, 125,
125, 125, 140, 125,
125, 125, 0, 125,
0, 125, 125, 125] for bar in range(20)] ## idle blue
while True:
for i in range(20):
for j in range(3, 19):
current = universe[i][j]
if current == 255:
delta = randrange(-1,1)
elif current == 0:
delta = randrange(0, 2)
else:
delta = randrange(-1, 2)
universe[i][j] = (current + delta) % 255
bars.send(universe)
sleep(0.1)