42 lines
987 B
C++
42 lines
987 B
C++
#include <Adafruit_I2CDevice.h>
|
|
#include <Adafruit_GFX.h>
|
|
#include <Adafruit_NeoMatrix.h>
|
|
#include <Adafruit_NeoPixel.h>
|
|
#define PIN D7 //DIN MATRIZ
|
|
String texto = "UNELECTRONICA";
|
|
String mensaje = "UNELECTRONICA";
|
|
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;
|
|
|
|
|
|
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();
|
|
} |