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

Global variables for GPIO & Nb of LED

parent c909dcd8
Branches
Tags
No related merge requests found
from machine import Pin from machine import Pin
from neopixel import NeoPixel from neopixel import NeoPixel
np_led = 64
gpio_neopixel = 0
class color: class color:
BLACK = (0, 0, 0) BLACK = (0, 0, 0)
BLUE = (0, 0, 255) BLUE = (0, 0, 255)
...@@ -10,11 +13,11 @@ class color: ...@@ -10,11 +13,11 @@ class color:
RED = (255, 0, 0) RED = (255, 0, 0)
def init_neopixel(): def init_neopixel():
return NeoPixel(Pin(0, Pin.OUT), 64) return NeoPixel(Pin(gpio_neopixel, Pin.OUT), np_led)
class matrix: class matrix:
def clear(color): def clear(color):
np = init_neopixel() np = init_neopixel()
for i in range(64): for i in range(np_led):
np[i] = color np[i] = color
np.write() np.write()
\ 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