Files
LED-Matrix/main/LEDMatrix.h
2024-11-30 16:48:48 +01:00

24 lines
620 B
C++

#ifndef LEDMATRIX_H
#define LEDMATRIX_H
#include <FastLED.h>
#include <stdint.h>
class LEDMatrix {
public:
LEDMatrix(uint8_t width, uint8_t height, uint16_t numLeds, uint16_t lastVisibleLed, CRGB* leds);
uint16_t XY(uint8_t x, uint8_t y);
void drawPixel(uint8_t x, uint8_t y, CRGB color);
void drawChar(char c, int x, int y, CRGB color);
void drawText(const char* text, int x, int y, CRGB color);
private:
const uint8_t kMatrixWidth;
const uint8_t kMatrixHeight;
const uint16_t NUM_LEDS;
const uint16_t LAST_VISIBLE_LED;
const int* XYTable;
CRGB* leds; // Add this line
};
#endif // LEDMATRIX_H