LedDisplay/vscode/OmobiLEDdisplayBluetooth/src/main.cpp

43 lines
1.6 KiB
C++
Raw Normal View History

#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;
2020-10-18 15:10:20 +02:00
///----- Setup of display driver and topology: -------------------------------------------------------------------------
// For detailed information on NeoPixel and NeoTiles etc. - all around display topology setup please see here:
// https://github.com/Makuna/NeoPixelBus/wiki/Matrix-Panels-Support
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);
}
2020-10-18 15:10:20 +02:00
///--------------------------------------------------------------------------------------------------------------------
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
//Serial.printf("LDR value is: %d\n", analogRead(LDR_PIN));
display->loop();
delay(1);
}