diff --git a/README.md b/README.md
index d522d34..4493958 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,15 @@

Grand Unified LED Logic Software (G.U.L.L.S.)
+Tested
+- Basic CLED Strip
+- Basic CLED Matrix
+- Basic Logical Matrix
+- AlternateStrip
+- AlternateMatrix
+- CollisionStrip
+- CollisionMatrix (BROKEN!!!)
+
+
*I need to write something here*
##### LED Hardware Development Status
diff --git a/diagram.json b/diagram.json
index fb0f37a..f2d7c60 100644
--- a/diagram.json
+++ b/diagram.json
@@ -4,8 +4,8 @@
"editor": "wokwi",
"parts": [
{
- "type": "wokwi-arduino-uno",
- "id": "uno",
+ "type": "wokwi-arduino-mega",
+ "id": "mega",
"top": 100,
"left": 100.78,
"attrs": {
@@ -17,61 +17,106 @@
"top": 0,
"left": 0,
"attrs": {
- "pixels": "6"
+ "pixels": "24"
}
},
{
"id": "matrix",
"type": "wokwi-led-matrix",
"top": -200,
- "left": 500,
+ "left": 750,
"attrs": {
"rows": "6",
"cols": "6",
"layout": "serpentine",
- "pixelShape": "square"
+ "pixelShape": "circle"
}
},
{
"id": "matrix2",
"type": "wokwi-led-matrix",
- "top": -350,
- "left": 500,
+ "top": -50,
+ "left": 750,
"attrs": {
"rows": "6",
"cols": "6",
"layout": "serpentine",
- "pixelShape": "square"
+ "pixelShape": "circle"
}
},
{
"id": "matrix3",
"type": "wokwi-led-matrix",
- "top": -500,
- "left": 500,
+ "top": 100,
+ "left": 750,
"attrs": {
"rows": "6",
"cols": "6",
"layout": "serpentine",
- "pixelShape": "square"
+ "pixelShape": "circle"
+ }
+ },
+ {
+ "id": "matrix4",
+ "type": "wokwi-led-matrix",
+ "top": 250,
+ "left": 750,
+ "attrs": {
+ "rows": "6",
+ "cols": "6",
+ "layout": "serpentine",
+ "pixelShape": "circle"
+ }
+ },
+ {
+ "id": "matrix5",
+ "type": "wokwi-led-matrix",
+ "top": 400,
+ "left": 750,
+ "attrs": {
+ "rows": "6",
+ "cols": "6",
+ "layout": "serpentine",
+ "pixelShape": "circle"
+ }
+ },
+ {
+ "id": "matrix6",
+ "type": "wokwi-led-matrix",
+ "top": 550,
+ "left": 750,
+ "attrs": {
+ "rows": "6",
+ "cols": "6",
+ "layout": "serpentine",
+ "pixelShape": "circle"
}
}
],
"connections": [
- ["uno:0", "$serialMonitor:TX", ""],
- ["uno:1", "$serialMonitor:RX", ""],
- ["uno:GND.2", "neopixels:VSS", "black"],
- ["uno:6", "neopixels:DIN", "green"],
- ["uno:5V", "neopixels:VDD", "red"],
- ["uno:7", "matrix:DIN", "yellow"],
- ["uno:5V", "matrix:VDD", "red"],
- ["uno:GND.3", "matrix:VSS", "black"],
+ ["mega:0", "$serialMonitor:TX", ""],
+ ["mega:1", "$serialMonitor:RX", ""],
+ ["mega:GND.2", "neopixels:VSS", "black"],
+ ["mega:6", "neopixels:DIN", "green"],
+ ["mega:5V", "neopixels:VDD", "red"],
+ ["mega:7", "matrix:DIN", "yellow"],
+ ["mega:5V", "matrix:VDD", "red"],
+ ["mega:GND.3", "matrix:VSS", "black"],
["matrix:DOUT", "matrix2:DIN", "blue"],
- ["uno:5V", "matrix2:VDD", "red"],
- ["uno:GND.3", "matrix2:VSS", "black"],
+ ["mega:5V", "matrix2:VDD", "red"],
+ ["mega:GND.3", "matrix2:VSS", "black"],
["matrix2:DOUT", "matrix3:DIN", "blue"],
- ["uno:5V", "matrix3:VDD", "red"],
- ["uno:GND.3", "matrix3:VSS", "black"]
+ ["mega:5V", "matrix3:VDD", "red"],
+ ["mega:GND.3", "matrix3:VSS", "black"],
+ ["matrix3:DOUT", "matrix4:DIN", "blue"],
+ ["mega:5V", "matrix4:VDD", "red"],
+ ["mega:GND.3", "matrix4:VSS", "black"],
+ ["matrix4:DOUT", "matrix5:DIN", "blue"],
+ ["mega:5V", "matrix5:VDD", "red"],
+ ["mega:GND.3", "matrix5:VSS", "black"],
+ ["matrix5:DOUT", "matrix6:DIN", "blue"],
+ ["mega:5V", "matrix6:VDD", "red"],
+ ["mega:GND.3", "matrix6:VSS", "black"]
],
"dependencies": {},
"serialMonitor": {
diff --git a/platformio.ini b/platformio.ini
index a8a8730..0692e36 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[platformio]
-default_envs = uno
+default_envs = mega
[env:uno]
platform = atmelavr
@@ -20,6 +20,18 @@ lib_deps =
pfeerick/elapsedMillis@^1.0.6
adafruit/Adafruit GFX Library@^1.11.9
arduino-libraries/SD@^1.3.0
+ apechinsky/MemoryFree@^0.3.0
+
+[env:mega]
+platform = atmelavr
+board = megaatmega2560
+framework = arduino
+lib_deps =
+ fastled/FastLED@3.10.1
+ pfeerick/elapsedMillis@^1.0.6
+ adafruit/Adafruit GFX Library@^1.11.9
+ arduino-libraries/SD@^1.3.0
+ apechinsky/MemoryFree@^0.3.0
[common]
@@ -32,3 +44,4 @@ lib_deps =
pixelmatix/SmartMatrix@^4.0.3
pfeerick/elapsedMillis@^1.0.6
adafruit/Adafruit GFX Library@^1.11.9
+ apechinsky/MemoryFree@^0.3.0
diff --git a/src/main.cpp b/src/main.cpp
index ca49cab..725264e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -6,10 +6,18 @@
#include "CLEDControllerPhysicalMatrix.h"
#include "SerpentineArrangement.h"
#include "TiledSerpentineArrangement.h"
+#include "MemoryFree.h"
+#include "elapsedMillis.h"
+#include "LogicalMatrix.h"
+#include "AlternateStrip.h"
+#include "AnimationBase.h"
+#include "AlternateMatrix.h"
+#include "CollisionStrip.h"
+#include "CollisionMatrix.h"
-#define NUMLEDS 6
+#define NUMLEDS 24
#define WIDTH 6
-#define HEIGHT 18
+#define HEIGHT 36
#define TILE_WIDTH 6
#define TILE_HEIGHT 6
@@ -20,12 +28,19 @@ CRGB rainbow[] = {CRGB::Red, CRGB::Orange, CRGB::Yellow, CRGB::Green, CRGB::Blue
LEDHAL* hal;
LEDHAL2D* hal2D;
+LogicalMatrix* lm1;
+LogicalMatrix* lm2;
+AnimationBase* animation;
+AnimationBase* animationMatrix;
+AnimationBase* animationMatrix2;
uint16_t shiftNumber = 0;
SerpentineArrangement arrangement(false);
TiledSerpentineArrangement tileArrangement(false, true, TILE_WIDTH, TILE_HEIGHT);
+elapsedMillis memoryPrintTimer;
+
void setup() {
Serial.begin(115200);
Serial.println("Hello World!");
@@ -34,21 +49,55 @@ void setup() {
hal = new CLEDControllerPhysicalStrip(controller, "Test Strip");
hal2D = new CLEDControllerPhysicalMatrix(controller2D, "Test Matrix", arrangement, WIDTH, HEIGHT);
+ lm1 = new LogicalMatrix("LM1", hal2D, 0, 0, 6, HEIGHT / 2);
+ lm2 = new LogicalMatrix("LM2", hal2D, 0, HEIGHT / 2, 6, HEIGHT);
+
+ /*animation = new AlternateStrip(hal, "Alternate Strip", 150, rainbow, 6);
+ animation->enable();
+
+ animationMatrix = new AlternateMatrix(lm1, "Alternate Matrix", 150, rainbow, 6, AlternateType::HORIZONTAL_ALTERNATE);
+ animationMatrix->enable();
+
+ animationMatrix2 = new AlternateMatrix(lm2, "Alternate Matrix 2", 150, rainbow, 6, AlternateType::VERTICAL_ALTERNATE);
+ animationMatrix2->enable();*/
+
+ animation = new CollisionStrip(hal, "Collision Strip", 150, CRGB::Orange, CRGB::Green);
+ animation->enable();
+
+ animationMatrix = new CollisionMatrix(hal2D, "Collision Matrix", 150, CRGB::Orange, CRGB::Green, CollisionType::HORIZONTAL_COLLISION);
+ animationMatrix->enable();
+
+ animationMatrix2 = new CollisionMatrix(hal2D, "Collision Matrix 2", 150, CRGB::Orange, CRGB::Green, CollisionType::VERTICAL_COLLISION);
+ animationMatrix2->enable();
}
void loop() {
- for(uint8_t i = 0; i < 6; i++) {
+ /*for(uint8_t i = 0; i < NUMLEDS; i++) {
hal->setColor(i, rainbow[(i + shiftNumber) % 6]);
- }
+ }*/
+ animation->update();
+ animationMatrix->update();
+ animationMatrix2->update();
+
+ /*
for(uint8_t i = 0; i < HEIGHT; i++) {
hal2D->drawFastHLine(0, i, WIDTH, rainbow[(i + shiftNumber) % 6]);
- }
+ } */
+
+ /*for(uint8_t i = 0; i < HEIGHT / 2; i++) {
+ lm1->drawFastHLine(0, i, WIDTH, rainbow[(i + shiftNumber) % 6]);
+ lm2->drawFastHLine(0, HEIGHT / 2 - 1 - i, WIDTH, rainbow[(i + shiftNumber) % 6]);
+ }*/
hal->requestShow();
hal->show();
hal2D->requestShow();
hal2D->show();
- shiftNumber++;
- delay(300);
+ //shiftNumber++;
+
+ if(memoryPrintTimer >= 1000) {
+ Serial.println(freeMemory());
+ memoryPrintTimer = 0;
+ }
}
diff --git a/wokwi.toml b/wokwi.toml
index 91af336..9f16bcf 100644
--- a/wokwi.toml
+++ b/wokwi.toml
@@ -1,5 +1,5 @@
[wokwi]
version = 1
-firmware = '.pio/build/uno/firmware.hex'
-elf = '.pio/build/uno/firmware.elf'
+firmware = '.pio/build/mega/firmware.hex'
+elf = '.pio/build/mega/firmware.elf'
gdbServerPort=3333
\ No newline at end of file