Skip to content

Instantly share code, notes, and snippets.

@smching
Created March 1, 2016 14:26
Show Gist options
  • Save smching/310a11cabadb4a20a9db to your computer and use it in GitHub Desktop.
Save smching/310a11cabadb4a20a9db to your computer and use it in GitHub Desktop.
Arduino based RGB Matrix LED tester
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#define CLK 8 // MUST be on PORTB!
#define LAT A3
#define OE 9
#define A A0
#define B A1
#define C A2
// Last parameter = 'false' disable double-buffering
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
void setup() {
matrix.begin();
}
void loop() {
// fill the screen with red
matrix.fillRect(0, 0, 32, 16, matrix.Color333(7, 0, 0));
delay(1000);
// fill the screen with green
matrix.fillRect(0, 0, 32, 16, matrix.Color333(0, 7, 0));
delay(1000);
// fill the screen with blue
matrix.fillRect(0, 0, 32, 16, matrix.Color333(0, 0, 7));
delay(1000);
// fill the screen with white
matrix.fillRect(0, 0, 32, 16, matrix.Color333(7, 7, 7));
delay(1000);
// fill the screen with black
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment