#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#define PIN 5 // Data pin for matrix
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(
32, 8, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE,
NEO_GRB + NEO_KHZ800);
int x = matrix.width();
int pass = 0;
void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(240);
}
uint16_t rainbowColor(int pos) {
// Simple rainbow gradient
pos = pos % 256;
if (pos < 85) {
return matrix.Color(pos * 3, 255 - pos * 3, 0);
} else if (pos < 170) {
pos -= 85;
return matrix.Color(255 - pos * 3, 0, pos * 3);
} else {
pos -= 170;
return matrix.Color(0, pos * 3, 255 - pos * 3);
}
}
void loop() {
matrix.fillScreen(0);
// English text
matrix.setCursor(x, 0);
matrix.setTextColor(rainbowColor(x));
matrix.print(F("Code by Arvind"));
// Marathi text below
matrix.setCursor(x, 6); // second line
matrix.setTextColor(rainbowColor(x + 50));
matrix.print(F("कोड बाय अरविंद"));
if (--x < -150) {
x = matrix.width();
if (++pass >= 3) pass = 0;
}
matrix.show();
delay(50);
}
https://wokwi.com/projects/new/esp32-s3
https://wokwi.com/projects/463072232587753473