current position:Home>Arduino Painless Development _LED8*8 Dot Matrix Experiment (Detailed)
Arduino Painless Development _LED8*8 Dot Matrix Experiment (Detailed)
2022-08-06 18:29:28【BIGBOSSyifi】
准备元件
An ugly one8*8LED点阵(16/18引脚)No registers were used in this experiment所以需要大量的杜邦线
Arduino Mega
同理,8*8至少16的引脚,Mega是最适合的
LED_8*8点阵原理图
8* 8 LED点阵共由 64 个发光二极管组成,Each LED is placed at the intersection of the row and column lines,and the corresponding behavior 1 电平,列置 0 电平,The coordinate diode is on; Light up a row in the same way:第 1 脚要接高电平,【A,B,C,D,E,F,G,H 】接低电平,The first row lights up;反之,第 a 脚接低电平,而【】1、2、3、4、5、6、7、8】接高电平,The first column lights up;
PS:The row is connected to the anode of the diode,为高电平,The column is connected to the cathode of the diode,为低电平
LED_8*8Dot matrix wiring diagram
18引脚平面示意图
16引脚
for a symmetrical distribution,16Pin Plane Pin Diagram
PS:The actual pins of some components can be messy,This depends on the actual pin of the component
接线部分
for convenience,I soldered on the board,The breadboard will be looser小建议 接线的时候,A row and a column are connected in a certain orderMega(See the code definition for details)
PS:The diagram above roughly simulates the wiring sequence,It is not the wiring diagram of this experiment
Arduino代码部分
int Row[] = {30, 31, 32, 33, 34, 35, 36, 37};//Define row pins
int Column[] = {22, 23, 24, 25, 26, 27, 28, 29};//Define column pins
unsigned char Light[8][8] = //'全亮'
{
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
};
unsigned char Dark[8][8] = //'全灭'
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
void setup() {
// The matrix code runs once:
for(int i = 0; i < 8; i++)
{
pinMode(Row[i], OUTPUT);//输出模式
pinMode(Column[i], OUTPUT);//输出模式
}
}
void loop() {
//The main code runs in a loop:
for(int i = 0; i< 100; i++)
{
Display(Light);
}
for(int i = 0; i< 100; i++)
{
Display(Dark);
}
}
void Display(unsigned char lattice[8][8])//显示函数
{
for(int r = 0; r < 8; r++)
{
digitalWrite(Row[r], LOW);
for(int c = 0; c < 8; c++)
{
digitalWrite(Column[c], lattice[r][c]);
}
delay(1);
Clear();
}
}
void Clear()//清除函数
{
for(int i = 0; i < 8; i++)
{
digitalWrite(Row[i], HIGH);
digitalWrite(Column[i], LOW);
}
}
复制代码
After compiling and uploading successfully,LEDThe lights began to flicker
Draw your favorite pattern
This part is the drawing panel,You can imagine the pattern you want to draw(‘1’代表亮灯,‘0’为熄灭) 例如:
unsigned char bigheart[8][8] = //'爱心'
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 0, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 0,
0, 0, 1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 1, 0, 0, 0,
};
复制代码
大概是这样子:
LOVE爱心~表白
int Row[] = {30, 31, 32, 33, 34, 35, 36, 37};//Define row pins
int Column[] = {22, 23, 24, 25, 26, 27, 28, 29};//Define column pins
unsigned char bigheart[8][8] = //'大心'
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 0, 0, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 0,
0, 0,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 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 1, 0, 0,
0, 0, 0, 1, 1, 0, 0, 0,
};
unsigned char E[8][8] = //'E'
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 0,
};
unsigned char U[8][8] = //'U'
{
1, 0, 0, 0, 0, 0, 0, 1,
1, 0, 0, 0, 0, 0, 0, 1,
1, 0, 0, 0, 0, 0, 0, 1,
1, 0, 0, 0, 0, 0, 0, 1,
1, 0, 0, 0, 0, 0, 0, 1,
1, 1, 0, 0, 0, 0, 1, 1,
0, 1, 1, 0, 0, 0, 1, 1,
0, 0, 1, 1, 1, 1, 0, 0,
};
void setup() {
// The matrix code runs once:
for(int i = 0; i < 8; i++)
{
pinMode(Row[i], OUTPUT);//输出模式
pinMode(Column[i], OUTPUT);//输出模式
}
}
void loop() {
//The main code runs in a loop:
for(int i = 0; i< 100; i++)
{
Display(I);
}
for(int i = 0; i< 100; i++)
{
Display(L);
}
for(int i = 0; i< 100; i++)
{
Display(O);
}
for(int i = 0; i< 100; i++)
{
Display(V);
}
for(int i = 0; i< 100; i++)
{
Display(E);
}
for(int i = 0; i< 100; i++)
{
Display(U);
}
for(int i = 0; i< 100; i++)
{
Display(bigheart);
}
for(int i = 0; i < 100; i++)
{
Display(smallheart);
}
for(int i = 0; i< 100; i++)
{
Display(bigheart);
}
for(int i = 0; i < 100; i++)
{
Display(smallheart);
}
for(int i = 0; i < 100; i++)
{
Display(bigheart);
}
}
void Display(unsigned char lattice[8][8])//显示函数
{
for(int r = 0; r < 8; r++)
{
digitalWrite(Row[r], LOW);
for(int c = 0; c < 8; c++)
{
digitalWrite(Column[c], lattice[r][c]);
}
delay(1);
Clear();
}
}
void Clear()//清除函数
{
for(int i = 0; i < 8; i++)
{
digitalWrite(Row[i], HIGH);
digitalWrite(Column[i], LOW);
}
}
复制代码
实物效果
copyright notice
author[BIGBOSSyifi],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/218/202208061824285981.html
The sidebar is recommended
- How to use wireless serial communication module to realize long-distance communication between touch screen and PLC?
- Getting Started with Vue2 - Rookie Level 1
- HTTP and HTTPS protocols
- 2022 Autumn Recruitment Front-end Interview Questions (1) (with answers)
- From function computing to serverless architecture
- Before 2022 the autumn recruit face questions (with answers) (2)
- About git's fatal: unable to access 'https://gitee.com/': Could not resolve host: gitee.com; Unknown error
- The sinkhole of Nginx's current limit!!
- Write a progress bar in JavaScript
- Write input box validation in JavaScript
guess what you like
CSS knowledge points
Write a random color in JavaScript
Construct HTTP
Webstorm opens and browses md files with garbled characters?
PHP+HTML+MySQL realizes login error
The comments in the Dygraphs Annotations
[React] Part VI Life Cycle
[React] Part VII Dom's diffing algorithm
To React the React in the setState after data didn't change
[React] The problem of React project startup stuck in Starting the development server...
Random recommended
- [React] The eighth part of react scaffolding installation and react scaffolding configuration agent
- [React] Part 5 Higher-Order Functions and Currying of Functions
- form and CSS
- In the Vue named Vue 】 【 encountered when component name "index" should always be multi - solution of word
- A pit in Nginx forwarding, operation and maintenance actually let me take the blame
- Easily converts HTML to PDF BFO Publisher
- vue2 typescript style type error?
- The back-end json is transferred to the front-end, but the front-end does not display?
- The sinkhole of Nginx current limit
- nginx service upgrade
- Vue gets the width and height attributes of the file file
- html submit form does not jump to the page
- CSS Tricks You Need to Know: Images
- Huawei FreeBuds Pro 2 review: the strongest TWS is here, this is the ceiling of wireless headphones
- Docker deploys a single page application
- Nginx and CDN
- vue click.stop stops the click event from continuing to propagate (stops the event from bubbling up)
- js array to remove the specified element [function encapsulation] (including object array to remove the specified element)
- CSS Drawing [Summary]
- [Webpack Quick Start] How to manually configure a webpack packaging tool for the project?
- The React components used in Spring MVC project
- Two Set collections get the same elements
- Samsung's Vietnam factory is operating at less than half, regretting closing production lines in China
- Send data to the front end with nodejs
- The implementation of the dotted line of the HTML+CSS common skills that the front end must know
- Front end will be commonly used HTML + CSS skills of mobile terminal 1 px borders
- Dedecms dream weaving template front-end list page data duplication solution
- vue-quill-editor rich text editor will clear spaces for content, filter empty strings, spaces; solution
- How to turn on the wireless screen mirroring function in win7
- Operation and maintenance practice - the latest Nginx binary build and compile lua-nginx-module dynamic link Lua script access Redis database read static resources implicit display
- Win7 wireless network list does not show up Win7 network connection icon disappears what to do
- Win7 and win10 which takes up less resources Win7 and win10 take up resources in detail
- JavaScript Knowledge Point Review--(2) Advanced Functions
- Openresty+nginx image server configuration, add http_image_filter_module module
- Docker quickly builds a PHP+Nginx+Mysql environment and steps on the pit diary
- Vue entry page for the first time, how to distinguish between created and activated?
- [Help] In the vue2 that the vue3 project is connected to as a subsystem, the whole project using el-drawer reports an error?
- Sketch91: How to set an aligned reference object and align it according to the specified element tutorial
- Study together to build the react + webpack + ts framework!!!!!!(a)
- Java Data Structures and Algorithms Lesson 9 - Sorting