More work, lots of validation effort
This commit is contained in:
10
README.md
10
README.md
@@ -1,5 +1,15 @@
|
|||||||
<img src="images/terrible logo.png" width="300" height="175"/><h1>Grand Unified LED Logic Software (G.U.L.L.S.)</h1>
|
<img src="images/terrible logo.png" width="300" height="175"/><h1>Grand Unified LED Logic Software (G.U.L.L.S.)</h1>
|
||||||
|
|
||||||
|
Tested
|
||||||
|
- Basic CLED Strip
|
||||||
|
- Basic CLED Matrix
|
||||||
|
- Basic Logical Matrix
|
||||||
|
- AlternateStrip
|
||||||
|
- AlternateMatrix
|
||||||
|
- CollisionStrip
|
||||||
|
- CollisionMatrix (BROKEN!!!)
|
||||||
|
|
||||||
|
|
||||||
*I need to write something here*
|
*I need to write something here*
|
||||||
|
|
||||||
##### LED Hardware Development Status
|
##### LED Hardware Development Status
|
||||||
|
|||||||
91
diagram.json
91
diagram.json
@@ -4,8 +4,8 @@
|
|||||||
"editor": "wokwi",
|
"editor": "wokwi",
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"type": "wokwi-arduino-uno",
|
"type": "wokwi-arduino-mega",
|
||||||
"id": "uno",
|
"id": "mega",
|
||||||
"top": 100,
|
"top": 100,
|
||||||
"left": 100.78,
|
"left": 100.78,
|
||||||
"attrs": {
|
"attrs": {
|
||||||
@@ -17,61 +17,106 @@
|
|||||||
"top": 0,
|
"top": 0,
|
||||||
"left": 0,
|
"left": 0,
|
||||||
"attrs": {
|
"attrs": {
|
||||||
"pixels": "6"
|
"pixels": "24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "matrix",
|
"id": "matrix",
|
||||||
"type": "wokwi-led-matrix",
|
"type": "wokwi-led-matrix",
|
||||||
"top": -200,
|
"top": -200,
|
||||||
"left": 500,
|
"left": 750,
|
||||||
"attrs": {
|
"attrs": {
|
||||||
"rows": "6",
|
"rows": "6",
|
||||||
"cols": "6",
|
"cols": "6",
|
||||||
"layout": "serpentine",
|
"layout": "serpentine",
|
||||||
"pixelShape": "square"
|
"pixelShape": "circle"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "matrix2",
|
"id": "matrix2",
|
||||||
"type": "wokwi-led-matrix",
|
"type": "wokwi-led-matrix",
|
||||||
"top": -350,
|
"top": -50,
|
||||||
"left": 500,
|
"left": 750,
|
||||||
"attrs": {
|
"attrs": {
|
||||||
"rows": "6",
|
"rows": "6",
|
||||||
"cols": "6",
|
"cols": "6",
|
||||||
"layout": "serpentine",
|
"layout": "serpentine",
|
||||||
"pixelShape": "square"
|
"pixelShape": "circle"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "matrix3",
|
"id": "matrix3",
|
||||||
"type": "wokwi-led-matrix",
|
"type": "wokwi-led-matrix",
|
||||||
"top": -500,
|
"top": 100,
|
||||||
"left": 500,
|
"left": 750,
|
||||||
"attrs": {
|
"attrs": {
|
||||||
"rows": "6",
|
"rows": "6",
|
||||||
"cols": "6",
|
"cols": "6",
|
||||||
"layout": "serpentine",
|
"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": [
|
"connections": [
|
||||||
["uno:0", "$serialMonitor:TX", ""],
|
["mega:0", "$serialMonitor:TX", ""],
|
||||||
["uno:1", "$serialMonitor:RX", ""],
|
["mega:1", "$serialMonitor:RX", ""],
|
||||||
["uno:GND.2", "neopixels:VSS", "black"],
|
["mega:GND.2", "neopixels:VSS", "black"],
|
||||||
["uno:6", "neopixels:DIN", "green"],
|
["mega:6", "neopixels:DIN", "green"],
|
||||||
["uno:5V", "neopixels:VDD", "red"],
|
["mega:5V", "neopixels:VDD", "red"],
|
||||||
["uno:7", "matrix:DIN", "yellow"],
|
["mega:7", "matrix:DIN", "yellow"],
|
||||||
["uno:5V", "matrix:VDD", "red"],
|
["mega:5V", "matrix:VDD", "red"],
|
||||||
["uno:GND.3", "matrix:VSS", "black"],
|
["mega:GND.3", "matrix:VSS", "black"],
|
||||||
["matrix:DOUT", "matrix2:DIN", "blue"],
|
["matrix:DOUT", "matrix2:DIN", "blue"],
|
||||||
["uno:5V", "matrix2:VDD", "red"],
|
["mega:5V", "matrix2:VDD", "red"],
|
||||||
["uno:GND.3", "matrix2:VSS", "black"],
|
["mega:GND.3", "matrix2:VSS", "black"],
|
||||||
["matrix2:DOUT", "matrix3:DIN", "blue"],
|
["matrix2:DOUT", "matrix3:DIN", "blue"],
|
||||||
["uno:5V", "matrix3:VDD", "red"],
|
["mega:5V", "matrix3:VDD", "red"],
|
||||||
["uno:GND.3", "matrix3:VSS", "black"]
|
["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": {},
|
"dependencies": {},
|
||||||
"serialMonitor": {
|
"serialMonitor": {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = uno
|
default_envs = mega
|
||||||
|
|
||||||
[env:uno]
|
[env:uno]
|
||||||
platform = atmelavr
|
platform = atmelavr
|
||||||
@@ -20,6 +20,18 @@ lib_deps =
|
|||||||
pfeerick/elapsedMillis@^1.0.6
|
pfeerick/elapsedMillis@^1.0.6
|
||||||
adafruit/Adafruit GFX Library@^1.11.9
|
adafruit/Adafruit GFX Library@^1.11.9
|
||||||
arduino-libraries/SD@^1.3.0
|
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]
|
[common]
|
||||||
|
|
||||||
@@ -32,3 +44,4 @@ lib_deps =
|
|||||||
pixelmatix/SmartMatrix@^4.0.3
|
pixelmatix/SmartMatrix@^4.0.3
|
||||||
pfeerick/elapsedMillis@^1.0.6
|
pfeerick/elapsedMillis@^1.0.6
|
||||||
adafruit/Adafruit GFX Library@^1.11.9
|
adafruit/Adafruit GFX Library@^1.11.9
|
||||||
|
apechinsky/MemoryFree@^0.3.0
|
||||||
|
|||||||
63
src/main.cpp
63
src/main.cpp
@@ -6,10 +6,18 @@
|
|||||||
#include "CLEDControllerPhysicalMatrix.h"
|
#include "CLEDControllerPhysicalMatrix.h"
|
||||||
#include "SerpentineArrangement.h"
|
#include "SerpentineArrangement.h"
|
||||||
#include "TiledSerpentineArrangement.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 WIDTH 6
|
||||||
#define HEIGHT 18
|
#define HEIGHT 36
|
||||||
#define TILE_WIDTH 6
|
#define TILE_WIDTH 6
|
||||||
#define TILE_HEIGHT 6
|
#define TILE_HEIGHT 6
|
||||||
|
|
||||||
@@ -20,12 +28,19 @@ CRGB rainbow[] = {CRGB::Red, CRGB::Orange, CRGB::Yellow, CRGB::Green, CRGB::Blue
|
|||||||
|
|
||||||
LEDHAL* hal;
|
LEDHAL* hal;
|
||||||
LEDHAL2D* hal2D;
|
LEDHAL2D* hal2D;
|
||||||
|
LogicalMatrix* lm1;
|
||||||
|
LogicalMatrix* lm2;
|
||||||
|
AnimationBase* animation;
|
||||||
|
AnimationBase* animationMatrix;
|
||||||
|
AnimationBase* animationMatrix2;
|
||||||
|
|
||||||
uint16_t shiftNumber = 0;
|
uint16_t shiftNumber = 0;
|
||||||
|
|
||||||
SerpentineArrangement arrangement(false);
|
SerpentineArrangement arrangement(false);
|
||||||
TiledSerpentineArrangement tileArrangement(false, true, TILE_WIDTH, TILE_HEIGHT);
|
TiledSerpentineArrangement tileArrangement(false, true, TILE_WIDTH, TILE_HEIGHT);
|
||||||
|
|
||||||
|
elapsedMillis memoryPrintTimer;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Serial.println("Hello World!");
|
Serial.println("Hello World!");
|
||||||
@@ -34,21 +49,55 @@ void setup() {
|
|||||||
|
|
||||||
hal = new CLEDControllerPhysicalStrip(controller, "Test Strip");
|
hal = new CLEDControllerPhysicalStrip(controller, "Test Strip");
|
||||||
hal2D = new CLEDControllerPhysicalMatrix(controller2D, "Test Matrix", arrangement, WIDTH, HEIGHT);
|
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() {
|
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]);
|
hal->setColor(i, rainbow[(i + shiftNumber) % 6]);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
animation->update();
|
||||||
|
animationMatrix->update();
|
||||||
|
animationMatrix2->update();
|
||||||
|
|
||||||
|
/*
|
||||||
for(uint8_t i = 0; i < HEIGHT; i++) {
|
for(uint8_t i = 0; i < HEIGHT; i++) {
|
||||||
hal2D->drawFastHLine(0, i, WIDTH, rainbow[(i + shiftNumber) % 6]);
|
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->requestShow();
|
||||||
hal->show();
|
hal->show();
|
||||||
hal2D->requestShow();
|
hal2D->requestShow();
|
||||||
hal2D->show();
|
hal2D->show();
|
||||||
shiftNumber++;
|
//shiftNumber++;
|
||||||
delay(300);
|
|
||||||
|
if(memoryPrintTimer >= 1000) {
|
||||||
|
Serial.println(freeMemory());
|
||||||
|
memoryPrintTimer = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[wokwi]
|
[wokwi]
|
||||||
version = 1
|
version = 1
|
||||||
firmware = '.pio/build/uno/firmware.hex'
|
firmware = '.pio/build/mega/firmware.hex'
|
||||||
elf = '.pio/build/uno/firmware.elf'
|
elf = '.pio/build/mega/firmware.elf'
|
||||||
gdbServerPort=3333
|
gdbServerPort=3333
|
||||||
Reference in New Issue
Block a user