Created
March 19, 2025 12:35
-
-
Save maxpromer/801fb62fe01740d1076032bb099eb087 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <ESP32-HUB75-MatrixPanel-I2S-DMA.h> | |
| #define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module. | |
| #define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module. | |
| #define PANEL_CHAIN 1 // Total number of panels chained one to another | |
| // Module configuration | |
| HUB75_I2S_CFG mxconfig( | |
| PANEL_RES_X, // module width | |
| PANEL_RES_Y, // module height | |
| PANEL_CHAIN // Chain length | |
| ); | |
| // Display Setup | |
| MatrixPanel_I2S_DMA matrix(mxconfig); | |
| uint32_t Wheel(byte WheelPos); | |
| void setup() { | |
| Serial.begin(115200); | |
| matrix.begin(); | |
| // fill the screen with 'black' | |
| matrix.fillScreen(matrix.color565(0, 0, 0)); | |
| { | |
| matrix.setCursor(28 / 2, 2); | |
| const char* str = "P5 RGB"; | |
| for (uint8_t i = 0; i < strlen(str); i++) { | |
| matrix.setTextColor(Wheel(i * 20)); | |
| matrix.print(str[i]); | |
| } | |
| matrix.println(); | |
| } | |
| { | |
| matrix.setCursor(8, 8 + 2 + 2); | |
| const char* str = "64x32 Px"; | |
| for (uint8_t i = 0; i < strlen(str); i++) { | |
| matrix.setTextColor(Wheel(200 + (i * 20))); | |
| matrix.print(str[i]); | |
| } | |
| matrix.println(); | |
| } | |
| { | |
| matrix.setCursor(2, 8 + 8 + 2 + 2 + 2); | |
| matrix.setTextColor(matrix.color565(0, 120, 255)); | |
| matrix.print("Ar"); | |
| matrix.setTextColor(matrix.color565(46, 134, 193)); | |
| matrix.print("tron"); | |
| matrix.setTextColor(matrix.color565(0, 255, 0)); | |
| matrix.print("Shop"); | |
| matrix.println(); | |
| } | |
| } | |
| void loop() { | |
| // do nothing | |
| } | |
| uint32_t Wheel(byte WheelPos) { | |
| WheelPos = 255 - WheelPos; | |
| if (WheelPos < 85) { | |
| return matrix.color565(255 - WheelPos * 3, 0, WheelPos * 3); | |
| } | |
| if (WheelPos < 170) { | |
| WheelPos -= 85; | |
| return matrix.color565(0, WheelPos * 3, 255 - WheelPos * 3); | |
| } | |
| WheelPos -= 170; | |
| return matrix.color565(WheelPos * 3, 255 - WheelPos * 3, 0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment