|
楼主 |
发表于 2013-7-7 16:00
|
显示全部楼层
我还有一个直接用arduino点亮一个灯的程序。我用的是arduino Mega 2560的板子。
用Arduino点亮点阵上的一个LED灯的程序:
// testshapes demo for RGBmatrixPanel library.
// Demonstrates the drawing abilities of the RGBmatrixPanel library.
// For 32x32 RGB LED matrix.
#include <Adafruit_GFX.h> // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
// If your 32x32 matrix has the SINGLE HEADER input,
// use this pinout:
#define CLK 50 // MUST be on PORTB!
#define OE 51
#define LAT 52
#define A A0
#define B A1
#define C A2
#define D A3
// If your matrix has the DOUBLE HEADER input, use:
//#define CLK 8 // MUST be on PORTB!
//#define LAT 9
//#define OE 10
//#define A A3
//#define B A2
//#define C A1
//#define D A0
RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);
void setup() {
matrix.begin();
// draw a pixel in solid white
matrix.drawPixel(0, 0, matrix.Color333(7, 7, 7));
delay(500);
// whew!
}
void loop() {
// do nothing
} |
|