A number of changes to try to get to the point where I could use Wokwi for some basic testing of animations
This commit is contained in:
17
src/main.cpp
17
src/main.cpp
@@ -1,7 +1,9 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef CORE_TEENSY
|
||||
#include "MatrixHardware_Teensy3_ShieldV1toV3.h"
|
||||
#include "SmartMatrix.h"
|
||||
#endif
|
||||
|
||||
#include "FastLED.h"
|
||||
#include "LEDHAL.h"
|
||||
@@ -12,6 +14,8 @@
|
||||
|
||||
#define NUMLEDS 24
|
||||
|
||||
|
||||
#ifdef CORE_TEENSY
|
||||
#define COLOR_DEPTH 24 // known working: 24, 48 - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24
|
||||
|
||||
const uint8_t kMatrixWidth = 96; // known working: 32, 64, 96, 128
|
||||
@@ -25,7 +29,7 @@ const uint8_t kScrollingLayerOptions = (SM_SCROLLING_OPTIONS_NONE);
|
||||
|
||||
SMARTMATRIX_ALLOCATE_BUFFERS(matrix, kMatrixWidth, kMatrixHeight, kRefreshDepth, kDmaBufferRows, kPanelType, kMatrixOptions);
|
||||
SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kBackgroundLayerOptions);
|
||||
|
||||
#endif
|
||||
|
||||
CRGB leds[NUMLEDS];
|
||||
CRGB leds2[NUMLEDS];
|
||||
@@ -37,21 +41,10 @@ LEDHAL* hal;
|
||||
LEDHAL2D* hal2D;
|
||||
LEDHAL2D* smHAL;
|
||||
|
||||
rgb24 canRGB24Translate(rgb24 color) {
|
||||
color.red = 0;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void setup() {
|
||||
CLEDController* controller = &FastLED.addLeds<NEOPIXEL, 6>(leds, NUMLEDS);
|
||||
CLEDController* controller2d = &FastLED.addLeds<NEOPIXEL, 7>(leds2, NUMLEDS);
|
||||
|
||||
hal = new CLEDControllerPhysicalStrip(controller, "Test Strip");
|
||||
hal2D = new CLEDControllerPhysicalMatrix(controller2d, "Test Matrix", ArrangementType::COLUMNSERPENTINE, 6, 4);
|
||||
smHAL = new SmartMatrixPhysicalMatrix(&backgroundLayer, "Test SM Matrix", kMatrixWidth, kMatrixHeight);
|
||||
|
||||
canRGB24Translate(someColor);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user