“开源LED点阵屏幕/zh”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
第4行: 第4行:
 
|-
 
|-
 
|
 
|
==概述==
+
==Outline==
*项目名称:Microduino LED点阵屏幕
+
*Project:Microduino LED dot matrix screen
*目的:熟悉Microduino Dot Matrix 点阵的使用
+
*Objective:TO be acquainted with the use of the Microduino Dot Matrix.
*难度:低级
+
*Difficulty:Low
*耗时:1小时
+
*Time-consuming:1 hour
*制作者:peng
+
*Maker:peng
  
==材料清单==
+
==Bill of Material==
 
{| border="0" cellpadding="10" width="100%"
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|-
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
===模块清单===
+
===Bill of Module===
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
|模块||数量||功能
+
|Function||Number||Function
 
|-
 
|-
|[[Microduino-Core/zh]]||1||核心板
+
|[[Microduino-Core]]||1||Core board
 
|-
 
|-
|[[Microduino-USBTTL/zh]]||1||下载程序
+
|[[Microduino-USBTTL]]||1||Program download
 
|-
 
|-
|[[Microduino-Module Dot Matrix/zh]]||1||显示
+
|[[Microduino-Module Dot Matrix]]||1||Display
 
|-
 
|-
|[[Microduino-Cube-S1/zh]]||1||扩展
+
|[[Microduino-Cube-S1]]||1||Extension
 
|-
 
|-
 
|}
 
|}
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
===其他材料===
+
===Other Material===
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
|部件||数量||功能
+
|Unit||Number||Function
 
|-
 
|-
|USB数据线||1||供电,下载
+
|USB cable||1||Power supply, and download
 
|-
 
|-
|LED点阵屏幕外壳套件   || 1 ||外壳
+
|LED dot matrix screen shell suite   || 1 ||Shell
 
|-
 
|-
|双面胶   || 2 ||粘外壳
+
|Double-sided adhesive   || 2 ||To stick the shell
 
|}
 
|}
 
|}
 
|}
  
==实验原理==
+
==Principle of the Experiment==
*'''[[Microduino-Module Dot Matrix/zh]]'''模块特点:
+
*Features of the module '''[[Microduino-Dot Matrix]]'''
**模块为8x8点阵,尺寸60mm*60mm;
+
**The module is 8x8 dot matrix, and the size is 60mm*60mm;
**每个点颜色显示质量为24位,整体32k彩色显示效果
+
**The color display quality of each point is 24 bits, and the color display effect of the entity is 32k.
**支持IIC通讯协议,IIC地址可设(1~64)
+
**Support IIC communication protocol, and the IIC address can be set(1~64).
  
==程序下载==
+
==Program Download==
*请保持更新下载Microduino官方最新的IDE
+
*Please keep to download and update the Microduino official latest IDE.
*从下面链接下载程序:[https://github.com/wasdpkj/Library_for_Microduino/tree/master/_01_Microduino_DotMatrix '''Dot-Matrix-base.ino''']
+
*You can download a program from the link below:[https://github.com/wasdpkj/Library_for_Microduino/tree/master/_01_Microduino_DotMatrix '''Dot-Matrix-base.ino''']
  
==程序烧写==
+
==Programming==
*'''[[Microduino-Core/zh]]''''''[[Microduino-USBTTL/zh]]'''堆叠在一起。
+
*Overlay '''[[Microduino-Core]]''' and '''[[Microduino-USBTTL]]''' together.
**用数据线连接其中的'''[[Microduino-USBTTL/zh]]'''准备上传程序。
+
** Connect '''[[Microduino-USBTTL]]''' with USB cable and prepare to upload the program.
**注意:最好不要将所有模块堆叠在一起之后再上传程序
+
**Note:Please upload programs before stacking all modules ntogether.
*打开Arduino IDE for Microduino,环境,(搭建参考:'''[[AVR核心:Getting started/zh]]''')
+
*Open Arduino IDE for Microduino environment.(The reference to set up:'''[[AVR Core:Getting started]]''')
*点击'''【工具】''',确认'''板卡(Microduino-Core),处理器(Atmega328P@16M,5V)'''选择无误,并选中对应'''端口号(COMX)'''
+
*Click '''[Tool]''', confirm '''board card(Microduino-Core) and processor(Atmega328P@16M,5V)''' selected correctly, and select the corresponding '''port number(COMX)'''.
*点击'''【文件】'''->'''【打开】''',浏览到项目程序地址,点击'''“Dot-Matrix-Base.ino”'''程序打开
+
*Click '''[File]'''->'''[Open]''', browse to the project program address and click '''“Dot-Matrix-Base.ino”''' to open the program.
*几项都无误后,点击'''"→"'''按钮下载程序到开发板上
+
*After all these items are right, click '''"→"''' button to download the program to the development board.
  
==拼装过程==
+
==Installation==
 
{| border="0" cellpadding="10" width="100%"
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|-
第68行: 第68行:
  
 
*'''Step1''':
 
*'''Step1''':
**'''结构A3'''垂直插入'''结构A1'''
+
**Insert '''structure A3''' vertically into '''structure A1'''.
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
[[File:Matrixjiegou1.jpg|500px|center]]
 
[[File:Matrixjiegou1.jpg|500px|center]]
第77行: 第77行:
  
 
*'''Step2''':
 
*'''Step2''':
**利用'''结构B2''''''结构A1''''''结构A2'''连接
+
**Use '''structure B2''' to connect '''structure A1''' and '''structure A2'''.
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
[[File:Matrixjiegou2.jpg|500px|center]]
 
[[File:Matrixjiegou2.jpg|500px|center]]
第86行: 第86行:
  
 
*'''Step3''':
 
*'''Step3''':
**'''结构B1'''也嵌入'''结构B2''',最后用'''结构B3''''''结构B4'''卡住'''结构B2'''
+
**Implant '''structure B1''' into '''structure B2''', and finally, use '''structure B3''' and '''structure B4''' to jam '''structure B2'''.
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
[[File:Matrixjiegou3.jpg|500px|center]]
 
[[File:Matrixjiegou3.jpg|500px|center]]
第95行: 第95行:
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
*'''Step4''':
 
*'''Step4''':
**更改点阵模块IIC地址可以参考[[https://www.microduino.cn/wiki/index.php/Microduino-Module_Dot_Matrix/zh#.E7.82.B9.E9.98.B5.E5.9C.B0.E5.9D.80.E8.AE.BE.E7.BD.AE.E6.96.B9.E6.B3.95 点阵模块IIC地址设置方法]]教程
+
**When changing the IIC address of the dot matrix, you can refer to [[https://www.microduino.cn/wiki/index.php/Microduino-Module_Dot_Matrix/zh#.E7.82.B9.E9.98.B5.E5.9C.B0.E5.9D.80.E8.AE.BE.E7.BD.AE.E6.96.B9.E6.B3.95 method to set the IIC address of the dot matrix module]] tutorial.
**预留点阵模块靠近按键接口的连线,以便于连接'''[[Microduino-Cube-S1/zh]]'''的IIC接口
+
**Reserve the wire which is near to the key interface of the dot matrix module,  in order to make the connection to the IIC interface of '''[[Microduino-Cube-S1]]''' easier.
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
[[File:Matrixjiegou5.jpg|500px|center]]
 
[[File:Matrixjiegou5.jpg|500px|center]]
第106行: 第106行:
  
 
*'''Step5''':
 
*'''Step5''':
**将点阵模块用双面胶粘在外壳内
+
**Stick the dot matrix module to the shell with double-sided adhesive.
**将以下模块叠在'''[[Microduino-Cube-S1/zh]]'''
+
**Overlay the following modules on the '''[[Microduino-Cube-S1]]'''.
***'''[[Microduino-Core/zh]]'''
+
***'''[[Microduino-Core]]'''
***'''[[Microduino-USBTTL/zh]]'''
+
***'''[[Microduino-USBTTL]]'''
**'''[[Microduino-Cube-S1/zh]]'''粘在'''结构B1'''背面
+
**Stick the '''[[Microduino-Cube-S1]]''' on the back of '''structure B1'''.
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
[[File:Matrixjiegou4.jpg|500px|center]]
 
[[File:Matrixjiegou4.jpg|500px|center]]
第116行: 第116行:
 
|}
 
|}
  
==操作说明==
+
==Operating Instruction==
 
{| border="0" cellpadding="10" width="100%"
 
{| border="0" cellpadding="10" width="100%"
 
|-
 
|-
第122行: 第122行:
  
  
*成功的话则可以依次在点阵屏上显示以下图形和字符
+
*If successful, the dot matrix screen will display the following shapes and characters in turn.
**位图显示(取模)
+
**Bitmap display(delivery)
**位图显示(BMP文件)
+
**Bit map display(BMP film)
**Microduino字符横向流动
+
**Microduino characters flow transervely.
**Microduino字符纵向流动
+
**Microduino characters flow longitudinally.
**实心矩形
+
**Solid rectangle
**实心四边形
+
**Solid quadrilateral
**空心矩形
+
**Outlined rectangle
**空心四边形
+
**Outlined quadrilateral
**空心圆
+
**Hollow cylindrical
**实心圆
+
**Solid cylindrical
**直线
+
**Straight line
**流动mcookie字符
+
**Flowing mcookie character
**0-49计数
+
**0-49 counting
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
 
[[File: LEDMatrix.jpg|600px|top]]
 
[[File: LEDMatrix.jpg|600px|top]]
 
|}
 
|}
 
|}
 
|}
==代码说明==
+
==Code Instruction==
 
   uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { 64 }
 
   uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { 64 }
定义Dot Matrix模块设置的IIC地址为64和级联方式。
+
Define the IIC address that is set for Dot Matrix module is 64 and cascade type.
 
   display.getDeviceAddr(a)
 
   display.getDeviceAddr(a)
获得设备IIC地址
+
Get the IIC address of the device.
 
   display.getWidth(),display.getHeight()
 
   display.getWidth(),display.getHeight()
返回X,Y坐标
+
Return X,Y coordinates.
 
   display.setLedColor(x, y, random(0, 255), random(0, 255), random(0, 255))
 
   display.setLedColor(x, y, random(0, 255), random(0, 255), random(0, 255))
随机设置每个LED的颜色
+
Set the color of each LED randomly.
 
   display.clearDisplay()
 
   display.clearDisplay()
清理屏幕显示
+
Clean up the screen.
 
   display.setColor(X,Y,Z)
 
   display.setColor(X,Y,Z)
设置全屏颜色 X:红色 Y:绿色 Z:蓝色
+
Set the color of full screen. X:Red Y:Green  Z:Blue
 
   display.writeString("string", MODE, time ,z)
 
   display.writeString("string", MODE, time ,z)
string:任意字符串, MODE:MODE_H横向显示字符/MODE_V竖向显示字符, time:显示时间(流动速度) ,z:X/Y坐标
+
string:An arbitrary string. 
 +
MODE:MODE_H display characters horizontally. /MODE_V display characters vertically.
 +
time:Show time.(flow velocity).
 +
z:X/Y coordinate.
 
   display.drawBMP(X,Y,W,H,logoA)   
 
   display.drawBMP(X,Y,W,H,logoA)   
X:水平位坐标, Y:纵向坐标, W:图像的宽度, H:图像的高度, logoA:图像数组
+
X:Horizontal coordinates  Y:Longitudinal coordinate  W:The width of the image H:The height of the image  logoA: Image array.
 
   display.drawBMP(X,Y,logoB)
 
   display.drawBMP(X,Y,logoB)
X:水平位坐标, Y:纵向坐标,logoB:图像数组(因为logoB是BMP文件的数组,不需要再次获取图像的大小,深入了解BMP显示可参考[https://www.microduino.cn/wiki/index.php/Microduino%E7%82%B9%E9%98%B5%E6%A8%A1%E5%9D%97%E6%98%BE%E7%A4%BABMP%E5%BD%A9%E5%9B%BE/zh '''点阵模块显示BMP彩图'''])
+
X:Horizontal coordinates  Y:Longitudinal coordinate  logoB:Image array(Because logoB is the array of BMP file, you don’t need to obtain the image size again. To get in-depth knowledge about BMP, you can refer to [https://www.microduino.cn/wiki/index.php/Microduino%E7%82%B9%E9%98%B5%E6%A8%A1%E5%9D%97%E6%98%BE%E7%A4%BABMP%E5%BD%A9%E5%9B%BE ''' the dot matrix module display the BMP color graph''']).
 
   display.drawBox(X,Y,I,W)
 
   display.drawBox(X,Y,I,W)
函数用来画实心矩形 X:水平位坐标,Y:纵向坐标,I:长,W:宽
+
This function is used to drawing a solid rectangle.  X:Horizontal coordinate.  Y:Longitudinal coordinate.  I:Length.  W:Width.
 
   display.drawRBox(X, Y, I,W)
 
   display.drawRBox(X, Y, I,W)
函数用来画实心顶角弯曲矩形 X:水平位坐标,Y:纵向坐标,I:长,W:宽
+
This function is used to drawing a solid apex angle bending rectangular.  X:Horizontal coordinate.  Y:Longitudinal coordinate.  I:Length.  W:Width.
 
   display.drawFrame(X,Y,I,W)
 
   display.drawFrame(X,Y,I,W)
函数用来画空心矩形 X:水平位坐标,Y:纵向坐标,I:长,W:宽
+
This function is used to draw a hollow rectangle.  X:Horizontal coordinate.  Y:Longitudinal coordinate.  I:Length.  W:Width.
 
   display.drawRFrame(X,Y,I,W,)
 
   display.drawRFrame(X,Y,I,W,)
函数用来画空心顶角弯曲矩形 X:水平位坐标,Y:纵向坐标,I:长,W:宽
+
This function is used to draw a hollow apex angle bending rectangular.  X:Horizontal coordinate.  Y:Longitudinal coordinate.  I:Length.  W:Width.
 
   display.drawCircle(X,Y,D)
 
   display.drawCircle(X,Y,D)
函数用来画空心圆 X:水平位坐标,Y:纵向坐标,D:直径
+
This function is used to draw a hollow circle.  X:Horizontal coordinate.  Y:Longitudinal coordinate.  D:Diameter.
 
   display.drawDisc(X,Y,D)
 
   display.drawDisc(X,Y,D)
函数用来画实心圆 X:水平位坐标,Y:纵向坐标,D:直径
+
This function is to draw a solid circle.  X:Horizontal coordinate.  Y:Longitudinal coordinate.  D:Diameter.
 
   display.drawLine(X,Y,M,N)
 
   display.drawLine(X,Y,M,N)
用来画直线 X:起点水平位坐标,Y:起点纵向坐标,M:终点水平位坐标,N:终点纵向坐标
+
This function is to draw a straight line.  X:Starting point horizontal coordinate.  Y:Starting point longitudinal coordinate.  M:Finishing point horizontal coordinate.  N:Ending point longitudinal coordinate.
  
 
==FAQ==
 
==FAQ==
*'''Q:怎么知道IIC地址?'''
+
*'''Q:How to know the IIC address?'''
**A:查阅'''[[https://www.microduino.cn/wiki/index.php/Microduino-Module_Dot_Matrix/zh#.E7.82.B9.E9.98.B5.E5.9C.B0.E5.9D.80.E8.AE.BE.E7.BD.AE.E6.96.B9.E6.B3.95 点阵模块IIC地址设置方法]]'''教程
+
**A:Please refer to '''[[https://www.microduino.cn/wiki/index.php/Microduino-Module_Dot_Matrix/zh#.E7.82.B9.E9.98.B5.E5.9C.B0.E5.9D.80.E8.AE.BE.E7.BD.AE.E6.96.B9.E6.B3.95 method to set the IIC address of the dot matrix module]]''' tutorial.
*'''Q:怎么同时使用多块屏幕?'''
+
*'''Q:How to use multiple screens at the same time?'''
**A:在下一篇[[开源LED点阵时钟/zh]]会详细讲多块[[Microduino-Module Dot Matrix/zh]]级联
+
**A:In the next page [[Open Source LED Dot Matrix]], there will be specific introduction of the cascade of multiple [[Microduino-Dot Matrix Clock]].
*'''Q:为什么计数到20以后显示不全?'''
+
*'''Q:Why does it display incompletely after counting to 20?'''
**A:由于点阵分辨率只有8*8,像素点不够,因此20以后的数字屏幕会显示不全
+
**A:Because the dot matrix resolution is only 8*8, there are not enough pixels, and the screen can’t display the numbers after 20 completely.
 
|}
 
|}

2016年4月7日 (四) 09:12的版本

Language English


Outline

  • Project:Microduino LED dot matrix screen
  • Objective:TO be acquainted with the use of the Microduino Dot Matrix.
  • Difficulty:Low
  • Time-consuming:1 hour
  • Maker:peng

Bill of Material

Bill of Module

Function Number Function
Microduino-Core 1 Core board
Microduino-USBTTL 1 Program download
Microduino-Module Dot Matrix 1 Display
Microduino-Cube-S1 1 Extension

Other Material

Unit Number Function
USB cable 1 Power supply, and download
LED dot matrix screen shell suite 1 Shell
Double-sided adhesive 2 To stick the shell

Principle of the Experiment

  • Features of the module Microduino-Dot Matrix
    • The module is 8x8 dot matrix, and the size is 60mm*60mm;
    • The color display quality of each point is 24 bits, and the color display effect of the entity is 32k.
    • Support IIC communication protocol, and the IIC address can be set(1~64).

Program Download

  • Please keep to download and update the Microduino official latest IDE.
  • You can download a program from the link below:Dot-Matrix-base.ino

Programming

  • Overlay Microduino-Core and Microduino-USBTTL together.
    • Connect Microduino-USBTTL with USB cable and prepare to upload the program.
    • Note:Please upload programs before stacking all modules ntogether.
  • Open Arduino IDE for Microduino environment.(The reference to set up:AVR Core:Getting started
  • Click [Tool], confirm board card(Microduino-Core) and processor(Atmega328P@16M,5V) selected correctly, and select the corresponding port number(COMX).
  • Click [File]->[Open], browse to the project program address and click “Dot-Matrix-Base.ino” to open the program.
  • After all these items are right, click "→" button to download the program to the development board.

Installation

  • Step1:
    • Insert structure A3 vertically into structure A1.
  • Step2:
    • Use structure B2 to connect structure A1 and structure A2.
  • Step3:
    • Implant structure B1 into structure B2, and finally, use structure B3 and structure B4 to jam structure B2.

Operating Instruction


  • If successful, the dot matrix screen will display the following shapes and characters in turn.
    • Bitmap display(delivery)
    • Bit map display(BMP film)
    • Microduino characters flow transervely.
    • Microduino characters flow longitudinally.
    • Solid rectangle
    • Solid quadrilateral
    • Outlined rectangle
    • Outlined quadrilateral
    • Hollow cylindrical
    • Solid cylindrical
    • Straight line
    • Flowing mcookie character
    • 0-49 counting

600px

|}

Code Instruction

 uint8_t Addr[MatrixPix_X][MatrixPix_Y] = { 64 }

Define the IIC address that is set for Dot Matrix module is 64 and cascade type.

 display.getDeviceAddr(a)

Get the IIC address of the device.

 display.getWidth(),display.getHeight()

Return X,Y coordinates.

 display.setLedColor(x, y, random(0, 255), random(0, 255), random(0, 255))

Set the color of each LED randomly.

 display.clearDisplay()

Clean up the screen.

 display.setColor(X,Y,Z)

Set the color of full screen. X:Red Y:Green Z:Blue

 display.writeString("string", MODE, time ,z)

string:An arbitrary string. MODE:MODE_H display characters horizontally. /MODE_V display characters vertically. time:Show time.(flow velocity). z:X/Y coordinate.

 display.drawBMP(X,Y,W,H,logoA)  

X:Horizontal coordinates Y:Longitudinal coordinate W:The width of the image H:The height of the image logoA: Image array.

 display.drawBMP(X,Y,logoB)

X:Horizontal coordinates Y:Longitudinal coordinate logoB:Image array(Because logoB is the array of BMP file, you don’t need to obtain the image size again. To get in-depth knowledge about BMP, you can refer to the dot matrix module display the BMP color graph).

 display.drawBox(X,Y,I,W)

This function is used to drawing a solid rectangle. X:Horizontal coordinate. Y:Longitudinal coordinate. I:Length. W:Width.

 display.drawRBox(X, Y, I,W)

This function is used to drawing a solid apex angle bending rectangular. X:Horizontal coordinate. Y:Longitudinal coordinate. I:Length. W:Width.

 display.drawFrame(X,Y,I,W)

This function is used to draw a hollow rectangle. X:Horizontal coordinate. Y:Longitudinal coordinate. I:Length. W:Width.

 display.drawRFrame(X,Y,I,W,)

This function is used to draw a hollow apex angle bending rectangular. X:Horizontal coordinate. Y:Longitudinal coordinate. I:Length. W:Width.

 display.drawCircle(X,Y,D)

This function is used to draw a hollow circle. X:Horizontal coordinate. Y:Longitudinal coordinate. D:Diameter.

 display.drawDisc(X,Y,D)

This function is to draw a solid circle. X:Horizontal coordinate. Y:Longitudinal coordinate. D:Diameter.

 display.drawLine(X,Y,M,N)

This function is to draw a straight line. X:Starting point horizontal coordinate. Y:Starting point longitudinal coordinate. M:Finishing point horizontal coordinate. N:Ending point longitudinal coordinate.

FAQ

|}