Added some more blinking.
This commit is contained in:
parent
39628177e8
commit
eb49c6e6bf
BIN
__pycache__/master.cpython-37.pyc
Normal file
BIN
__pycache__/master.cpython-37.pyc
Normal file
Binary file not shown.
20
dice.py
Normal file
20
dice.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from master import ColourArray
|
||||||
|
from time import sleep
|
||||||
|
import sys
|
||||||
|
import random
|
||||||
|
|
||||||
|
c = ColourArray(iplist=('192.168.1.1', ))
|
||||||
|
|
||||||
|
one = [0,255,255]
|
||||||
|
zero = [255,255,0]
|
||||||
|
|
||||||
|
defaultArray = [[zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy()]]
|
||||||
|
|
||||||
|
num = random.randint(0,12)
|
||||||
|
|
||||||
|
array = defaultArray.copy()
|
||||||
|
array[0] = defaultArray[0].copy()
|
||||||
|
for i in range(num):
|
||||||
|
array[0][i] = one
|
||||||
|
c.send(array)
|
||||||
|
sleep(0.1)
|
@ -4,7 +4,7 @@ import sys
|
|||||||
def eprint(*args, **kwargs):
|
def eprint(*args, **kwargs):
|
||||||
print(*args, file=sys.stderr, **kwargs)
|
print(*args, file=sys.stderr, **kwargs)
|
||||||
|
|
||||||
iplist = ('192.168.1.1','192.168.1.211','192.168.1.109','192.168.1.178','192.168.1.244','192.168.1.179','192.168.1.196','192.168.1.133','192.168.1.217')
|
iplist = ('192.168.1.1')
|
||||||
|
|
||||||
|
|
||||||
class ColourArray:
|
class ColourArray:
|
||||||
|
25
movingdot.py
Normal file
25
movingdot.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from master import ColourArray
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
c = ColourArray(iplist=('192.168.1.1', ))
|
||||||
|
|
||||||
|
zero = [0,55,55]
|
||||||
|
one = [255,255,255]
|
||||||
|
|
||||||
|
#defaultArray = [[zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy(),zero.copy()]]
|
||||||
|
defaultArray=[[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255],[255,0,127],[255,0,0]]]
|
||||||
|
print(defaultArray)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for i in range(0,12):
|
||||||
|
array = defaultArray.copy()
|
||||||
|
array[0] = defaultArray[0].copy()
|
||||||
|
array[0][i] = one
|
||||||
|
c.send(array)
|
||||||
|
sleep(0.05)
|
||||||
|
for i in range(10,0,-1):
|
||||||
|
array = defaultArray.copy()
|
||||||
|
array[0] = defaultArray[0].copy()
|
||||||
|
array[0][i] = one
|
||||||
|
c.send(array)
|
||||||
|
sleep(0.05)
|
14
movingrainbow.py
Normal file
14
movingrainbow.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from master import ColourArray
|
||||||
|
from time import sleep
|
||||||
|
import numpy
|
||||||
|
|
||||||
|
c = ColourArray(iplist=('192.168.1.1', ))
|
||||||
|
|
||||||
|
rainbow=[[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255],[255,0,127],[255,0,0]]]
|
||||||
|
|
||||||
|
while True:
|
||||||
|
arr = numpy.array(rainbow.copy()[0])
|
||||||
|
for i in range(0,12):
|
||||||
|
arr = numpy.roll(arr,1,axis=0)
|
||||||
|
c.send([arr.tolist()])
|
||||||
|
sleep(0.03)
|
32
test.py
32
test.py
@ -1,35 +1,11 @@
|
|||||||
from master import ColourArray
|
from master import ColourArray
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
testColorData = [[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
testColorData = [[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]]]
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
colorful = [[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]]]
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
rainbow = [[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]]]
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]],
|
|
||||||
[[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255],[255,255,255]]]
|
|
||||||
colorful = [[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]],
|
|
||||||
[[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0],[0,255,0],[255,255,255],[255,0,255],[0,255,255],[255,255,0],[0,0,255],[255,0,0]]]
|
|
||||||
rainbow = [[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]],
|
|
||||||
[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[255,0,255]]]
|
|
||||||
|
|
||||||
c = ColourArray()
|
c = ColourArray(iplist=('192.168.1.1', ))
|
||||||
while True:
|
while True:
|
||||||
c.send(testColorData)
|
c.send(testColorData)
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user