Skip to content
Snippets Groups Projects
Commit 60eb340f authored by michael.divia's avatar michael.divia
Browse files

First try at Matrix function

parent 446b4aee
Branches
No related tags found
No related merge requests found
class Color:
BLACK = (0, 0, 0)
BLUE = (0, 0, 255)
CYAN = (0, 255, 255)
GREEN = (0, 255, 0)
MAGENTA = (255, 0, 255)
RED = (255, 0, 0)
\ No newline at end of file
from machine import Pin from machine import Pin
from neopixel import NeoPixel from neopixel import NeoPixel
import time from matrix import matrix
from color import color
pin = Pin(0, Pin.OUT) # set GPIO0 to output to drive NeoPixels pin = Pin(0, Pin.OUT) # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 64) # create NeoPixel driver on GPIO0 for 64 pixels np = NeoPixel(pin, 64) # create NeoPixel driver on GPIO0 for 64 pixels
while True: while True:
for j in range(3): matrix.clear(color.RED)
for i in range(0,64): \ No newline at end of file
if j == 0:
np[i] = (255, 0, 0)
elif j == 1:
np[i] = (0, 255, 0)
elif j == 2:
np[i] = (0, 0, 255)
np.write()
\ No newline at end of file
from machine import Pin
from neopixel import NeoPixel
from color import color
pin = Pin(0, Pin.OUT) # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 64) # create NeoPixel driver on GPIO0 for 64 pixels
class matrix:
def clear(self, color):
for i in range(0,64):
np[i] = color
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment