first_commit
This commit is contained in:
46
ESP8266/MatrixLedsRGB/src/matrix.hpp
Normal file
46
ESP8266/MatrixLedsRGB/src/matrix.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_NeoMatrix.h>
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#define PIN D7 //DIN MATRIZ
|
||||
String texto = "Puerto Ota: ";
|
||||
String mensaje = "Puerto Ota: ";
|
||||
String hora = "00:00:00";
|
||||
int R = 255;
|
||||
int G = 0;
|
||||
int B = 0;
|
||||
|
||||
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8, PIN,
|
||||
NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
|
||||
NEO_GRB + NEO_KHZ800);
|
||||
|
||||
int x = matrix.width();
|
||||
int longitud = 0;
|
||||
int pass = 0;
|
||||
|
||||
const uint16_t colors[] = {
|
||||
matrix.Color(255, 102, 0),
|
||||
matrix.Color(255, 204, 0),
|
||||
matrix.Color(128, 0, 128),
|
||||
matrix.Color(255, 0, 255)};
|
||||
|
||||
void matrix_init()
|
||||
{
|
||||
matrix.begin();
|
||||
matrix.setTextWrap(false);
|
||||
matrix.setBrightness(20);
|
||||
matrix.setTextColor(matrix.Color(R, G, B));
|
||||
}
|
||||
|
||||
void show_matrix()
|
||||
{
|
||||
matrix.fillScreen(0);
|
||||
matrix.setCursor(x, 1);
|
||||
matrix.print(texto);
|
||||
matrix.setTextColor(matrix.Color(R, G, B));
|
||||
if (--x < -1 * longitud)
|
||||
{
|
||||
x = matrix.width();
|
||||
|
||||
}
|
||||
matrix.show();
|
||||
}
|
||||
Reference in New Issue
Block a user