Added special dates, cleaned up unused scriptsx
This commit is contained in:
4
SpecialDates.json
Normal file
4
SpecialDates.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{'0730': ('l', 'Happy Birthday Heracles! ', .05, [(100, 0, 0), (90, 0, 0), (80, 0, 0), (70, 0, 0), (80, 0, 0), (90, 0, 0)]),
|
||||
|
||||
'0130': ('l', 'Happy Birthday Examplario! ', .1, [(80, 20, 0), (20, 80, 0), (0, 20, 80), (80, 0, 20)]),
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
import machine,neopixel
|
||||
|
||||
from time import sleep
|
||||
|
||||
|
||||
|
||||
words={"it":[0,1],
|
||||
|
||||
"is":[3,4],
|
||||
|
||||
"twenty":[6,11],
|
||||
|
||||
"-one":[13,15],
|
||||
|
||||
}
|
||||
|
||||
bigletters={"a":[0,2,4,6,8,10],
|
||||
|
||||
"b":[1,3,5,7,9,11],
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class display(object):
|
||||
|
||||
"""Initialises a NeoPixel-String."""
|
||||
|
||||
def __init__(self,DataPin,Rows=1,Columns=17):
|
||||
|
||||
self.np=neopixel.NeoPixel(machine.Pin(DataPin),Rows*Columns)
|
||||
|
||||
self.number=Rows*Columns
|
||||
|
||||
self.Rows=Rows
|
||||
|
||||
self.Columns=Columns
|
||||
|
||||
|
||||
|
||||
def write(self,Pos,Colour=(0,0,0), Immediate=True):
|
||||
|
||||
"""write(Pos,Colour=(0,0,0), Immediate=True): Writes a colour (given as an RGB triplet) to the Pixel
|
||||
|
||||
at position 'Pos'. If 'Immediate' is set, change immediately, otherwise, wait until the display is
|
||||
|
||||
explicitly written or a write with 'Immediate' is called."""
|
||||
|
||||
if Pos >= self.number:
|
||||
|
||||
print("Out of range")
|
||||
|
||||
else:
|
||||
|
||||
self.np[Pos]=Colour
|
||||
|
||||
if Immediate:
|
||||
|
||||
self.np.write()
|
||||
|
||||
|
||||
|
||||
def clear(self,Immediate=True):
|
||||
|
||||
"""Clears all pixels"""
|
||||
|
||||
for i in range(self.number):
|
||||
|
||||
self.np[i]=(0,0,0)
|
||||
|
||||
if Immediate:
|
||||
|
||||
self.np.write()
|
||||
Reference in New Issue
Block a user