G.U.L.L.S. rebuilt to use PlatformIO

This commit is contained in:
2024-07-01 19:18:45 -04:00
commit f934849576
55 changed files with 4082 additions and 0 deletions

59
src/main.cpp Normal file
View File

@@ -0,0 +1,59 @@
#include <Arduino.h>
#include "MatrixHardware_Teensy3_ShieldV1toV3.h"
#include "SmartMatrix.h"
#include "FastLED.h"
#include "LEDHAL.h"
#include "LEDHAL2D.h"
#include "CLEDControllerPhysicalStrip.h"
#include "CLEDControllerPhysicalMatrix.h"
#include "SmartMatrixPhysicalMatrix.h"
#define NUMLEDS 24
#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
const uint8_t kMatrixHeight = 64; // known working: 16, 32, 48, 64
const uint8_t kRefreshDepth = 36; // known working: 24, 36, 48
const uint8_t kDmaBufferRows = 4; // known working: 2-4, use 2 to save memory, more to keep from dropping frames and automatically lowering refresh rate
const uint8_t kPanelType = SMARTMATRIX_HUB75_32ROW_MOD16SCAN; // use SMARTMATRIX_HUB75_16ROW_MOD8SCAN for common 16x32 panels
const uint8_t kMatrixOptions = SMARTMATRIX_OPTIONS_BOTTOM_TO_TOP_STACKING; // see http://docs.pixelmatix.com/SmartMatrix for options
const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
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);
CRGB leds[NUMLEDS];
CRGB leds2[NUMLEDS];
CRGB leds3[NUMLEDS];
CRGB someColor(255, 255, 255);
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() {
// put your main code here, to run repeatedly:
}