diff --git a/1 - Code/color.py b/1 - Code/color.py deleted file mode 100644 index 5c9c42c5571025da8ffdfd55a0ca067105f9d5dc..0000000000000000000000000000000000000000 --- a/1 - Code/color.py +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/1 - Code/hl3.py b/1 - Code/hl3.py new file mode 100644 index 0000000000000000000000000000000000000000..e9ce3b4dfcdbc863516cefa68e3ff15c40069bc8 --- /dev/null +++ b/1 - Code/hl3.py @@ -0,0 +1,19 @@ +from machine import Pin +from neopixel import NeoPixel + +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) + +def init_neopixel(): + return NeoPixel(Pin(0, Pin.OUT), 64) + +class matrix: + def clear(self, color): + np = init_neopixel() + for i in range(0,64): + np[i] = color diff --git a/1 - Code/main.py b/1 - Code/main.py index 864173b7047cb70c8ff2f4b7f4b17aa250ee2b66..1d2ef82e813e47e3d9d70d677335037ac6ffca55 100644 --- a/1 - Code/main.py +++ b/1 - Code/main.py @@ -1,10 +1,5 @@ -from machine import Pin -from neopixel import NeoPixel -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 +from hl3 import color +from hl3 import matrix while True: - matrix.clear(color.RED) \ No newline at end of file + matrix.clear(color.RED) diff --git a/1 - Code/matrix.py b/1 - Code/matrix.py deleted file mode 100644 index 345e78e5e66ee599c96e3ef414778c64c2af9fa3..0000000000000000000000000000000000000000 --- a/1 - Code/matrix.py +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/2 - Reports/Michael_Divia.md b/2 - Reports/Michael_Divia.md index e82b304154e14ffec56ce71e897a6211b2b5fd27..6b835423744e79951f4c78649360f36771934f4e 100644 --- a/2 - Reports/Michael_Divia.md +++ b/2 - Reports/Michael_Divia.md @@ -9,6 +9,7 @@ - [Upload du code](#upload-du-code) - [Travail](#travail) - [Lundi, 17 Juin 2024](#lundi-17-juin-2024) + - [Mardi, 18 Juin 2024](#mardi-18-juin-2024) - [Creators](#creators) - [Copyright and license](#copyright-and-license) @@ -39,6 +40,10 @@ Après avoir flasher le bon Firmware sur de Raspberry Pi, j'ai pu vérifier le b J'ai ensuite pris du temps afin de souder des pin à la matrice de LED afin de facilité ça connexion à la Breadboard. J'ai ensuite commencé à concevoir la fonction `matrix`. +## Mardi, 18 Juin 2024 + +J'ai commencé par créer `hl3.py` afin d'avoir un fichier librairie avec toutes les fonctions que nous allons implémentées. Je me suis ensuite attelé à la finalisation de la fonction `matrix`. + # Creators **Michael Divià**