37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#include <Arduino.h>
|
|
#include "OmobiLedDisplay.h"
|
|
|
|
#define MATRIX_PIN 4
|
|
#define TILE_PIXEL_ROWS 8
|
|
#define TILE_PIXEL_COLS 8
|
|
#define MATRIX_TILES_ROW 1
|
|
#define MATRIX_TILES_COL 2
|
|
#define MATRIX_PIXEL_WIDTH TILE_PIXEL_COLS*MATRIX_TILES_COL
|
|
#define MATRIX_PIXEL_HEIGHT TILE_PIXEL_ROWS*MATRIX_TILES_ROW
|
|
|
|
OmobiLedDisplay *display;
|
|
|
|
NeoPixelBrightnessBusGfx<NeoGrbFeature, Neo800KbpsMethod> *displayMatrix = new NeoPixelBrightnessBusGfx<NeoGrbFeature, Neo800KbpsMethod>(MATRIX_PIXEL_WIDTH, MATRIX_PIXEL_HEIGHT, MATRIX_PIN);
|
|
NeoTiles <RowMajorLayout, RowMajorLayout> tiles(TILE_PIXEL_COLS, TILE_PIXEL_ROWS, MATRIX_TILES_COL,MATRIX_TILES_ROW);
|
|
// use a remap function to remap based on the topology, tile or mosaik
|
|
// this function is passed as remap function to the matrix
|
|
uint16_t remap(uint16_t x, uint16_t y) {
|
|
return tiles.Map(x, y);
|
|
}
|
|
|
|
void setup()
|
|
{
|
|
Serial.begin(115200);
|
|
Serial.printf("Los\n");
|
|
// create our display
|
|
displayMatrix->setRemapFunction(&remap);
|
|
display = new OmobiLedDisplay("OmobiLedDisplay1", displayMatrix);
|
|
|
|
}
|
|
|
|
void loop()
|
|
{
|
|
// nothing to do in loop
|
|
display->loop();
|
|
delay(1);
|
|
}
|