Cleaned up ledMatrix.py
This commit is contained in:
parent
c78f97614c
commit
97e1c138be
6 changed files with 1 additions and 84236 deletions
Binary file not shown.
|
|
@ -1,21 +1,13 @@
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
class Animation:
|
class Animation:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.matrices = []
|
self.matrices = []
|
||||||
for x in range(0, 50):
|
for x in range(0, 50):
|
||||||
self.matrices.append(Matrix())
|
self.matrices.append(Matrix())
|
||||||
|
|
||||||
# def __str__(self):
|
|
||||||
# returnArray = []
|
|
||||||
# for x in range(len(self.panels)):
|
|
||||||
# returnArray.append(str(self.panels[x]))
|
|
||||||
# return str(returnArray)
|
|
||||||
|
|
||||||
def toJSON(self):
|
|
||||||
return json.dumps(self, default=lambda o: o.__dict__,
|
|
||||||
sort_keys=True, indent=4)
|
|
||||||
|
|
||||||
class Matrix:
|
class Matrix:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -23,12 +15,6 @@ class Matrix:
|
||||||
for x in range(0, 20):
|
for x in range(0, 20):
|
||||||
self.panels.append(Panel())
|
self.panels.append(Panel())
|
||||||
|
|
||||||
# def __str__(self):
|
|
||||||
# returnArray = []
|
|
||||||
# for x in range(len(self.panels)):
|
|
||||||
# returnArray.append(str(self.panels[x]))
|
|
||||||
# return str(returnArray)
|
|
||||||
|
|
||||||
|
|
||||||
class Panel:
|
class Panel:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
@ -36,26 +22,9 @@ class Panel:
|
||||||
for x in range(0, 16):
|
for x in range(0, 16):
|
||||||
self.leds.append(LED())
|
self.leds.append(LED())
|
||||||
|
|
||||||
# def __str__(self):
|
|
||||||
# returnArray = []
|
|
||||||
# for x in range(len(self.leds)):
|
|
||||||
# returnArray.append(str(self.leds[x]))
|
|
||||||
# return str(returnArray)
|
|
||||||
|
|
||||||
|
|
||||||
class LED:
|
class LED:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.r = random.randrange(0, 255)
|
self.r = random.randrange(0, 255)
|
||||||
self.g = random.randrange(0, 255)
|
self.g = random.randrange(0, 255)
|
||||||
self.b = random.randrange(0, 255)
|
self.b = random.randrange(0, 255)
|
||||||
|
|
||||||
# def value(self):
|
|
||||||
# return self.r, self, g, self.b
|
|
||||||
|
|
||||||
# def __str__(self):
|
|
||||||
# return "r:" + str(self.r) + " g:" + str(self.g) + " b:" + str(self.b)
|
|
||||||
|
|
||||||
|
|
||||||
# class MatrixEncoder(JSONEncoder):
|
|
||||||
# def default(self, o):
|
|
||||||
# return o.__dict__
|
|
||||||
|
|
|
||||||
84204
Code/matrix.json
84204
Code/matrix.json
File diff suppressed because it is too large
Load diff
BIN
Code/matrix.zip
BIN
Code/matrix.zip
Binary file not shown.
Binary file not shown.
BIN
Code/merrick.dat
BIN
Code/merrick.dat
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue