From ef3eded08d745b64443fe21341aa7294cf76812f Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Sat, 20 Dec 2025 12:54:56 -0500 Subject: [PATCH] Push up existing wokwi changes --- diagram.json | 16 +++++++++++++++- include/ColorRandomizerMatrix.h | 2 ++ src/main.cpp | 10 ++++++++-- wokwi.toml | 3 ++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/diagram.json b/diagram.json index 3decc43..ee15084 100644 --- a/diagram.json +++ b/diagram.json @@ -3,7 +3,14 @@ "author": "Uri Shaked", "editor": "wokwi", "parts": [ - { "type": "board-xiao-esp32-s3", "id": "esp", "top": 1000, "left": 13.78, "attrs": {} }, + { + "type": "board-xiao-esp32-s3", + "id": "esp", + "top": 1000, + "left": 13.78, + "attrs": { + } + }, { "id": "neopixels", "type": "wokwi-neopixel-canvas", @@ -17,9 +24,16 @@ } ], "connections": [ + ["esp32:TX0", "$serialMonitor:RX", "", []], + ["esp32:RX0", "$serialMonitor:TX", "", []], ["esp:GND", "neopixels:VSS", "black"], ["esp:D5", "neopixels:DIN", "green"], ["esp:5V", "neopixels:VDD", "red"] ], + "serialMonitor": { + "display": "always", + "newline": "lf", + "convertEol": false + }, "dependencies": {} } \ No newline at end of file diff --git a/include/ColorRandomizerMatrix.h b/include/ColorRandomizerMatrix.h index b7a416c..dc2244d 100644 --- a/include/ColorRandomizerMatrix.h +++ b/include/ColorRandomizerMatrix.h @@ -38,6 +38,8 @@ class ColorRandomizerMatrix : public MatrixAnimation { } else { fadingValues = new CRGB[matrix->getWidth()]; } + + Serial.println("Initialize is ok"); } void execute(); diff --git a/src/main.cpp b/src/main.cpp index 61723e9..3280022 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,9 +52,15 @@ LEDHAL2D* hal2D; MatrixAnimation* animation; -int animationCode = 8; +int animationCode = 0; void setup() { + Serial.begin(115200); + + while(!Serial) {} + + Serial.println(F("STARTUP!")); + CLEDController* controller = &FastLED.addLeds(leds, NUMLEDS); controller->setCorrection(TypicalLEDStrip); @@ -69,7 +75,7 @@ void setup() { } else if(animationCode == 3) { //Doesn't work, causing heap corruption animation = new ColorRandomizerMatrix(hal2D, "Color Randomizer Matrix", - 40, true, 6, rainbow, ColorRandomizerType::HORIZONTAL_COLORRANDOMIZER); + 200, false, 6, rainbow, ColorRandomizerType::HORIZONTAL_COLORRANDOMIZER); } else if(animationCode == 4) { animation = new CycleLightMatrix(hal2D, "Cycle Light Matrix", 100, rainbow, 6, CycleLightType::HORIZONTAL_CYCLELIGHT); } else if(animationCode == 5) { diff --git a/wokwi.toml b/wokwi.toml index 62a5d76..df0e716 100644 --- a/wokwi.toml +++ b/wokwi.toml @@ -1,4 +1,5 @@ [wokwi] version = 1 firmware = '.pio/build/esp32/firmware.bin' -elf = '.pio/build/esp32/firmware.elf' \ No newline at end of file +elf = '.pio/build/esp32/firmware.elf' +gdbServerPort=3333 \ No newline at end of file