【星坛综艺会14 期,迎新春】DIY 红绿蓝发光二极管矩阵显示

【星坛综艺会14 期,迎新春】DIY 红绿蓝发光二极管矩阵显示

RGB LED Matrix Display with Arduino "AIDEXINGKONG 2025 Spring Festival" (爱的星空2025春节)

 

Control Board: Arduino Uno

Display Board: DC5V WS2812B RGB Flexible LED Panel Matrix Programmable Display Screen Lights

 

https://www.youtube.com/watch?v=PMT955n09pA

方法,见我以前发表过的一篇

“DIY: express 'I love you!' for someone for $50”:

https://bbs.wenxuecity.com/rdzn/4940014.html

The Program Code:

#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>

#define DATA_PIN 6

#define arr_len( x ) ( sizeof( x ) / sizeof( *x ) )

// setting matrix
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8, DATA_PIN,
NEO_MATRIX_TOP +  NEO_MATRIX_LEFT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE + NEO_MATRIX_ZIGZAG,
NEO_GRB + NEO_KHZ800);


char* Text[]= {"AIDEXINGKONG", "2025", "Spring Festival0"}; 
const uint16_t colors[] = {
  matrix.Color(255, 0, 255), matrix.Color(100,255,0), matrix.Color(255,255,0), matrix.Color(0,0,255), matrix.Color(255,0,255), matrix.Color(0,255,255), matrix.Color(255,255,255)};
int brightness = 80;
// end

int numMode =  arr_len(Text) - 1;
int numColor =  arr_len(colors)-1;
int pixelPerChar  =  4;
int maxDisplacement;
int mode =0;

void setup() {
  matrix.begin();
  matrix.setTextWrap(false);
  matrix.setBrightness(brightness);
  matrix.setTextColor(colors[0]);
}
int  y = matrix.height();
int  x = matrix.width();
int pass =  0;
int line_pass =0;

void loop() {
  if (mode > numMode) {mode = 0;}

  matrix.fillScreen(0);
  matrix.setCursor(x, 0);
  scroll(Text[mode], 15);
}
// scrolling
void scroll(char* message, int delays) {
  maxDisplacement = strlen(message) * pixelPerChar + matrix.width();
  if(++line_pass > matrix.width()) line_pass = 0;
 matrix.print(String(message));
 if(--x < -maxDisplacement) {
   x = matrix.width();
   if(++pass  >=  numColor) { pass = 0; };
  matrix.setTextColor(colors[pass]);
  mode++;
  }
  matrix.show();
  delay(delays);
  }
  

 

 

 




更多我的博客文章>>>

所有跟帖: 

厉害! -酒仙桥2- 给 酒仙桥2 发送悄悄话 酒仙桥2 的博客首页 (0 bytes) () 01/26/2025 postreply 11:10:51

不厉害。一年级小学生的课外作业。 -xia23- 给 xia23 发送悄悄话 xia23 的博客首页 (0 bytes) () 01/26/2025 postreply 11:55:59

电的东西得理工网友学 -云霞姐姐- 给 云霞姐姐 发送悄悄话 云霞姐姐 的博客首页 (0 bytes) () 01/26/2025 postreply 12:58:27

不是。是任何人都可以做的。 -xia23- 给 xia23 发送悄悄话 xia23 的博客首页 (0 bytes) () 01/26/2025 postreply 13:30:58

连code都贴上了,方便大家复制。新春快乐! -ToClouds- 给 ToClouds 发送悄悄话 ToClouds 的博客首页 (0 bytes) () 01/26/2025 postreply 13:05:43

谢谢。很容易做的。 我在帖里面有一个详细的做的方法的link。 -xia23- 给 xia23 发送悄悄话 xia23 的博客首页 (265 bytes) () 01/26/2025 postreply 13:28:15

夏兄这科研做的。。。棒!。。。小声说一句,我看不懂 ~ ~ ~ ~:) -老林子里的夏天- 给 老林子里的夏天 发送悄悄话 老林子里的夏天 的博客首页 (0 bytes) () 01/26/2025 postreply 16:50:17

非常容易做的。小菜一碟。 -xia23- 给 xia23 发送悄悄话 xia23 的博客首页 (0 bytes) () 01/27/2025 postreply 05:44:14

高! -laopika- 给 laopika 发送悄悄话 laopika 的博客首页 (0 bytes) () 01/26/2025 postreply 18:59:04

不高。这是最初级的microcontroller。国内是不是叫单片机? -xia23- 给 xia23 发送悄悄话 xia23 的博客首页 (0 bytes) () 01/27/2025 postreply 05:46:47

请您先登陆,再发跟帖!