论坛有朋友有用arduino来驱动RGB32*32,或者16*32单元板的吗?请求指导哦!
为了找1.8TFT的资料进了一个国外的网站,看到有玩RGB的,点亮了很漂亮,然后淘宝看一下Arduino Colorduino好贵呀,而且单个共阳的RGB点阵也好贵最便宜的都十几块,去年做工程用过RGB单元板,就想着这个便宜呀,7千多一个平方,单点一毛多一点,32*32才一百多,刚好那个国外网站有相关的教程和库,就搞了一块32*32的百来块,晚上到了点亮了,因为我用的是2560不是教程上UNO照着改好pin接好线,点亮了,能出来字但是有多出来的像素点显示,自己摸了一个下午还是这样,请问有没有坛友玩过的,可以指导一下吗?不胜感激!
就是下面那样:
国外网站:http://learn.adafruit.com/32x16-32x32-rgb-led-matrix/
[pre lang="arduino" line="1" file="32*32"]// 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);
// fix the screen with green
matrix.fillRect(0, 0, 32, 32, matrix.Color333(0, 7, 0));
delay(500);
// draw a box in yellow
matrix.drawRect(0, 0, 32, 32, matrix.Color333(7, 7, 0));
delay(500);
// draw an 'X' in red
matrix.drawLine(0, 0, 31, 31, matrix.Color333(7, 0, 0));
matrix.drawLine(31, 0, 0, 31, matrix.Color333(7, 0, 0));
delay(500);
// draw a blue circle
matrix.drawCircle(10, 10, 10, matrix.Color333(0, 0, 7));
delay(500);
// fill a violet circle
matrix.fillCircle(21, 21, 10, matrix.Color333(7, 0, 7));
delay(500);
// fill the screen with 'black'
matrix.fillScreen(matrix.Color333(0, 0, 0));
// draw some text!
matrix.setCursor(1, 0); // start at top left, with one pixel of spacing
matrix.setTextSize(1); // size 1 == 8 pixels high
matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves
matrix.setTextColor(matrix.Color333(7,7,7));
matrix.println(" Ada");
matrix.println("fruit");
// print each letter with a rainbow color
matrix.setTextColor(matrix.Color333(7,0,0));
matrix.print('3');
matrix.setTextColor(matrix.Color333(7,4,0));
matrix.print('2');
matrix.setTextColor(matrix.Color333(7,7,0));
matrix.print('x');
matrix.setTextColor(matrix.Color333(4,7,0));
matrix.print('3');
matrix.setTextColor(matrix.Color333(0,7,0));
matrix.println('2');
matrix.setTextColor(matrix.Color333(0,7,7));
matrix.print('*');
matrix.setTextColor(matrix.Color333(0,4,7));
matrix.print('R');
matrix.setTextColor(matrix.Color333(0,0,7));
matrix.print('G');
matrix.setTextColor(matrix.Color333(4,0,7));
matrix.print("B");
matrix.setTextColor(matrix.Color333(7,0,4));
matrix.print("*");
// whew!
}
void loop() {
// do nothing
}[/code] |