驴友花雕
发表于 2022-11-12 20:09:33
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之五:移动的空心圆和实心圆
/*
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之五:移动的空心圆和实心圆
*/
#include <Adafruit_GFX.h> //核心图形库
#include <RGBmatrixPanel.h> //硬件特定库
#define CLK 8 //必须在这个端口上! (在Mega上使用PIN 11)
#define LAT A3
#define OE9
#define A A0
#define B A1
#define C A2
//最后一个参数='false'禁用双屏障
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
void setup() {
matrix.begin(); //矩阵开始(启动)
}
void loop() {
matrix.drawCircle(7, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(8, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(9, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(10, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(11, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(12, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(13, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(14, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(15, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(16, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(17, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(18, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(19, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(20, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(21, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(22, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(23, 7, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(24, 8, 7, matrix.Color333(0, 0, 7));
delay(200);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(7, 7, 7, matrix.Color333(7, 0, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(8, 8, 7, matrix.Color333(7, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(9, 7, 7, matrix.Color333(0, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(10, 8, 7, matrix.Color333(0, 7, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(11, 7, 7, matrix.Color333(0, 0, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(12, 8, 7, matrix.Color333(7, 0, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(13, 7, 7, matrix.Color333(0, 7, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(14, 8, 7, matrix.Color333(7, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(15, 7, 7, matrix.Color333(0, 0, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(16, 8, 7, matrix.Color333(7, 0, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(17, 7, 7, matrix.Color333(0, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(18, 8, 7, matrix.Color333(7, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(19, 7, 7, matrix.Color333(0, 0, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(20, 8, 7, matrix.Color333(7, 0, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(21, 7, 7, matrix.Color333(0, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(22, 8, 7, matrix.Color333(7, 0, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(23, 7, 7, matrix.Color333(0, 0, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(24, 8, 7, matrix.Color333(0, 7, 7));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(15, 7, 7, matrix.Color333(0, 0, 7));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(15, 7, 7, matrix.Color333(0, 7, 0));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(15, 7, 7, matrix.Color333(7, 0, 7));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(15, 7, 7, matrix.Color333(7, 7, 0));
delay(300);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(15, 7, 7, matrix.Color333(0, 0, 7));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(15, 7, 7, matrix.Color333(0, 7, 0));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawCircle(15, 7, 7, matrix.Color333(7, 0, 0));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.fillCircle(15, 7, 7, matrix.Color333(0, 7, 0));
delay(500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
}
驴友花雕
发表于 2022-11-12 20:16:51
实验场景图
驴友花雕
发表于 2022-11-12 20:18:30
驴友花雕
发表于 2022-11-12 20:20:03
实验场景图动态图
驴友花雕
发表于 2022-11-12 20:55:46
实验的视频记录
优酷:https://v.youku.com/v_show/id_XNTkxOTY3OTYwOA==.html?spm=a2hcb.playlsit.page.1
B站:https://www.bilibili.com/video/BV1jG411F7Fo/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5
https://v.youku.com/v_show/id_XNTkxOTY3OTYwOA==.html?spm=a2hcb.playlsit.page.1
驴友花雕
发表于 2022-11-12 21:34:20
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之六:彩色边框与多彩英文字母
/*
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之六:彩色边框与多彩英文字母
*/
#include <Adafruit_GFX.h> //核心图形库
#include <RGBmatrixPanel.h> //硬件特定库
#define CLK 8 //必须在这个端口上! (在Mega上使用PIN 11)
#define LAT A3
#define OE9
#define A A0
#define B A1
#define C A2
//最后一个参数='false'禁用双屏障
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
void setup() {
matrix.begin(); //矩阵开始(启动)
}
void loop() {
matrix.drawRect(0, 0, 32, 16, matrix.Color333(7, 0, 0));
delay(300);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(0, 7, 0));
delay(300);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(0, 0, 7));
delay(300);
matrix.setCursor(5, 1);
matrix.setTextSize(2);
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('O');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('K');
delay(1000);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(0, 0, 7));
delay(300);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(0, 7, 0));
delay(300);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(7, 0, 0));
delay(300);
matrix.setCursor(5, 1);
matrix.setTextSize(2);
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('M');
matrix.setTextColor(matrix.Color333(7, 0, 7));
matrix.print('e');
delay(1000);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(7, 0, 7));
delay(300);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(7, 7, 0));
delay(300);
matrix.drawRect(0, 0, 32, 16, matrix.Color333(0, 7, 0));
delay(300);
matrix.setCursor(5, 1);
matrix.setTextSize(2);
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('G');
matrix.setTextColor(matrix.Color333(7, 7, 0));
matrix.print('O');
delay(1000);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(5);
}
驴友花雕
发表于 2022-11-12 21:55:18
实验场景图
驴友花雕
发表于 2022-11-12 21:56:57
驴友花雕
发表于 2022-11-12 21:58:19
实验场景图动态图
驴友花雕
发表于 2022-11-13 06:27:39
实验的视频记录
优酷:
B站:https://www.bilibili.com/video/BV1qP4y1y746/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5
https://www.bilibili.com/video/BV1qP4y1y746/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5
驴友花雕
发表于 2022-11-13 06:30:49
实验场景图
驴友花雕
发表于 2022-11-13 10:06:15
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之七:多彩打印“16X32 *RGB*”
/*
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之七:多彩打印“16X32 *RGB*”
*/
#include <Adafruit_GFX.h> //核心图形库
#include <RGBmatrixPanel.h> //硬件特定库
#define CLK 8 //必须在这个端口上! (在Mega上使用PIN 11)
#define LAT A3
#define OE9
#define A A0
#define B A1
#define C A2
//最后一个参数='false'禁用双缓冲
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
void setup() {
matrix.begin(); //矩阵开始(启动)
}
void loop() {
matrix.setCursor(1, 0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(4, 7, 0));
matrix.print('1');
delay(300);
matrix.setTextColor(matrix.Color333(6, 0, 4));
matrix.print('6');
delay(300);
matrix.setTextColor(matrix.Color333(1, 2, 7));
matrix.print('x');
delay(300);
matrix.setTextColor(matrix.Color333(6, 0, 1));
matrix.print('3');
delay(300);
matrix.setTextColor(matrix.Color333(2, 6, 1));
matrix.print('2');
delay(300);
matrix.setCursor(1, 9);
matrix.setTextColor(matrix.Color333(0, 7, 7));
matrix.print('*');
delay(300);
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('R');
delay(300);
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('G');
delay(300);
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('B');
delay(300);
matrix.setTextColor(matrix.Color333(7, 6, 1));
matrix.print("*");
delay(1500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(600);
matrix.setCursor(1, 0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('1');
matrix.setTextColor(matrix.Color333(7, 4, 0));
matrix.print('6');
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.print('2');
matrix.setCursor(1, 9);
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("*");
delay(1500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(600);
matrix.setCursor(1, 0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(7, 4, 4));
matrix.print('1');
matrix.setTextColor(matrix.Color333(4, 7, 4));
matrix.print('6');
matrix.setTextColor(matrix.Color333(4, 4, 7));
matrix.print('x');
matrix.setTextColor(matrix.Color333(7, 4, 4));
matrix.print('3');
matrix.setTextColor(matrix.Color333(4, 7, 4));
matrix.print('2');
matrix.setCursor(1, 9);
matrix.setTextColor(matrix.Color333(7, 4, 4));
matrix.print('*');
matrix.setTextColor(matrix.Color333(4, 4, 7));
matrix.print('R');
matrix.setTextColor(matrix.Color333(4, 7, 4));
matrix.print('G');
matrix.setTextColor(matrix.Color333(4, 4, 7));
matrix.print('B');
matrix.setTextColor(matrix.Color333(7, 4, 4));
matrix.print("*");
delay(1500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(600);
matrix.setCursor(1, 0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('1');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('6');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('x');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('3');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('2');
matrix.setCursor(1, 9);
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('*');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('R');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('G');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('B');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print("*");
delay(1500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(600);
matrix.setCursor(1, 0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('1');
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('6');
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('x');
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('3');
matrix.setTextColor(matrix.Color333(0, 0, 7));
matrix.print('2');
matrix.setCursor(1, 9);
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('*');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('R');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('G');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print('B');
matrix.setTextColor(matrix.Color333(7, 0, 0));
matrix.print("*");
delay(1500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(600);
matrix.setCursor(1, 0);
matrix.setTextSize(1);
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('1');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('6');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('x');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('3');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('2');
matrix.setCursor(1, 9);
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('*');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('R');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('G');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print('B');
matrix.setTextColor(matrix.Color333(0, 7, 0));
matrix.print("*");
delay(1500);
matrix.fillScreen(matrix.Color333(0, 0, 0));
delay(600);
}
驴友花雕
发表于 2022-11-13 11:23:43
实验场景图
驴友花雕
发表于 2022-11-13 11:25:33
实验场景图动态图
驴友花雕
发表于 2022-11-13 11:28:45
实验的视频记录
优酷:https://v.youku.com/v_show/id_XNTkxOTc3MDQyNA==.html?spm=a2hcb.playlsit.page.1
B站:https://www.bilibili.com/video/BV16R4y1Z7pr/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5
https://www.bilibili.com/video/BV16R4y1Z7pr/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5
驴友花雕
发表于 2022-11-13 11:30:55
驴友花雕
发表于 2022-11-13 11:44:45
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之八:你好世界! 这是滚动文字(左向流动)
/*
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之八:你好世界! 这是滚动文字(左向流动)
*/
#include <HUB75driver.h>
#include "font.h"
HUB75driver matrix;
const char str[] PROGMEM = { "Hello world! This is scrolling text :)" };
void setup() {
//if first argument is true double buffering used, need swapBuffers() to refresh
//if second argument is true additional dimming will be applyed. brightness will reduce by half
matrix.init(true, true);
matrix.begin();//Enable interupt
}
void loop() {
uint8_t i = 0;
uint8_t len = strlen_P(str);
for (i = 0; i < len; i++) {
for (uint8_t offset = 0; offset < 8; offset++) {
matrix.cleanScreen();
put_string_from_progmem(-offset, 4, str, i, 3, 0, 0);
//put_string_from_progmem(-offset+1, 4, str, i, r, g, b);
matrix.swapBuffers();
delay(25);
}
}
}
void put_string_from_progmem(uint8_t x, uint8_t y, const char message[], uint8_t start, uint8_t r, uint8_t g, uint8_t b) {
char c;
uint8_t len = strlen_P(message);
if (!message) return;
for (uint8_t i = 0; i < 5; i++) {
uint8_t offset = start + i;
if (offset < len) {
c = pgm_read_word_near(message + offset);
putNormalChar(x + 8 * i, y, c, r, g, b);
}
}
}
void putNormalChar(uint8_t x, uint8_t y, char c, uint8_t r, uint8_t g, uint8_t b) {
// fonts defined for ascii 32 and beyond (index 0 in font array is ascii 32);
byte charIndex = c - 32;
putChar(x, y, myfont8x8, 8, 8, r, g, b);
}
void putChar(uint8_t x, uint8_t y, const unsigned char * c, uint8_t h, uint8_t w, uint8_t r, uint8_t g, uint8_t b) {
for (byte row = 0; row < h; row++)
{
byte rowDots = pgm_read_byte_near(&c);
for (byte col = 0; col < w; col++)
{
if (rowDots & (1 << (col)))
matrix.drawPixel(x + col, y + row, r, g, b);
}
}
}
驴友花雕
发表于 2022-11-13 11:46:11
实验场景图
驴友花雕
发表于 2022-11-13 11:48:36
实验场景图动态图
驴友花雕
发表于 2022-11-13 12:08:56
实验的视频记录
优酷:https://v.youku.com/v_show/id_XNTkxODAwMjE2OA==.html?spm=a2hcb.playlsit.page.1
B站:https://www.bilibili.com/video/BV1cG4y1b7Hp/?vd_source=98c6b1fc23b2787403d97f8d3cc0b7e5
https://v.youku.com/v_show/id_XNTkxODAwMjE2OA==.html?spm=a2hcb.playlsit.page.1
驴友花雕
发表于 2022-11-13 19:16:35
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之九:打印汉字“东山”
/*
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验二百二十:P6全彩LED模组 16X32显示屏单元板 P6-RGB-16X32-8S
室内全彩8扫电子屏(HX-P6-16X32-A)
项目程序之九:打印汉字“东山”
*/
#include <Adafruit_GFX.h> //核心图形库
#include <RGBmatrixPanel.h> //硬件特定库
#define CLK 8 //必须在这个端口上! (在Mega上使用PIN 11)
#define LAT A3
#define OE9
#define A A0
#define B A1
#define C A2
//最后一个参数='false'禁用双缓冲
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
static const unsigned char PROGMEM bitmap = {0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x7F, 0xFC, 0x01, 0x00, 0x04, 0x00, 0x21, 0x08, 0x09, 0x00, 0x21, 0x08, 0x11, 0x00, 0x21, 0x08, 0x21, 0x00, 0x21, 0x08, 0x3F, 0xF8, 0x21, 0x08, 0x01, 0x00, 0x21, 0x08, 0x09, 0x20, 0x21, 0x08, 0x11, 0x10, 0x21, 0x08, 0x21, 0x08, 0x21, 0x08, 0x41, 0x04, 0x3F, 0xF8, 0x05, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00};
void setup() {
matrix.begin();
}
void loop() {
matrix.drawBitmap(0, 0, bitmap, 32, 16, matrix.Color333(0, 0, 7));
delay(1000);
matrix.drawBitmap(0, 0, bitmap, 32, 16, matrix.Color333(0, 7, 0));
delay(1000);
matrix.drawBitmap(0, 0, bitmap, 32, 16, matrix.Color333(7, 0, 0));
delay(1000);
}