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
No related branches found
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 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
np = NeoPixel(pin, 64) # create NeoPixel driver on GPIO0 for 64 pixels
while True:
for j in range(3):
for i in range(0,64):
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
matrix.clear(color.RED)
\ 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