#include <FastLED.h>
#include <LEDMatrix.h>
#include <LEDText.h>
#include <FontMatrise.h> // Egyszerű beépített 5x7 font
#define LED_PIN 5
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define MATRIX_WIDTH 32
#define MATRIX_HEIGHT 8
#define NUM_LEDS (MATRIX_WIDTH * MATRIX_HEIGHT)
CRGB leds[NUM_LEDS];
// LED mátrix beállítása (irány attól függ, hogyan van huzalozva)
cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, HORIZONTAL_ZIGZAG_MATRIX> matrix(leds);
cLEDText ScrollingMsg;
const char MsgString[] = "Hello ESP32 + FastLED! ";
void setup() {
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(50);
ScrollingMsg.SetFont(MatriseFontData);
ScrollingMsg.Init(&matrix, matrix.Width(), matrix.Height(), 0, 0);
ScrollingMsg.SetText((unsigned char *)MsgString, sizeof(MsgString) - 1);
ScrollingMsg.SetTextColrOptions(COLR_RGB, 255, 0, 0);
}
void loop() {
if (ScrollingMsg.UpdateText() == -1)
ScrollingMsg.SetText((unsigned char *)MsgString, sizeof(MsgString) - 1);
FastLED.show();
delay(40);
}