Presentation is loading. Please wait.

Presentation is loading. Please wait.

亚博科技 Arduino视频教程 第12讲 8乘8点阵.

Similar presentations


Presentation on theme: "亚博科技 Arduino视频教程 第12讲 8乘8点阵."— Presentation transcript:

1 亚博科技 Arduino视频教程 第12讲 8乘8点阵

2 8*8点阵介绍 亚博科技 Arduino视频教程
8X8点阵共由64个发光二极管组成,且每个发光二极管是放置在行线和列线的交叉点上,当对应的某一行置1电平,某一列置0电平,则相应的二极管就亮;如要将第一个点点亮,则9脚接高电平13脚接低电平,则第一个点就亮了;如果要将第一行点亮,则第9脚要接高电平,而(13、3、4、10、6、11、15、16)这些引脚接低电平,那么第一行就会点亮;如要将第一列点亮,则第13脚接低电平,而(9、14、8、12、1、7、2、5)接高电平,那么第一列就会点亮。 引号脚识别:点阵模块4条边,有一边上有丝印,且中间向下有塑料突起;插针向下放置,丝印面向自己,左起为1号脚,逆时针排列。只要其对应的行接高,列接低,即可点亮响应行列的LED。应用时需加限流电阻。

3 所示是引脚和对应的行列序号,R表示行,C表示列。引脚逆时针排列:
亚博科技 Arduino视频教程 所示是引脚和对应的行列序号,R表示行,C表示列。引脚逆时针排列: 8*8点阵应用 一般我们使用点阵显示汉字是用的16*16的点阵宋体字库,所谓16*16,是每一个汉字在纵、横各16点的区域内显示的。也就是说得用四 个8*8点阵组合成一个16*16的点阵。如下图所示,要显示“0”则相应的点就要点亮,由于我们的点阵在列线上是低电平有效,而在行线上是高电平有效,所以要显示“0”的话,第一行(9脚)送0信号,列脚均送1信号。依此类推,只要每行数据显示时间间隔够短,利用人眼的视觉暂停作用,这样送16次数据扫描完16行后就会看到一个“0”。

4 亚博科技 Arduino视频教程 号。依此类推,只要每行数据显示时间间隔够短,利用人眼的视觉暂停作用,这样送16次数据扫描完16行后就会看到一个“0”;第二种送数据的方法是字模信号送到行线上再扫描列线也是同样的道理。同样以“0”来说明,16行(9、14、8、12、1、7、2、5)上送( ,0x00,0x00)而第一列(13脚)送、“0”。同理扫描第二列。当行线上送了16次数据而列线扫描了16次后一个“0”也就显示出来了。因此,形成的列代码为 00H,00H,3EH,41H,41H,3EH,00H,00H;只要把这些代码分别依次送到相应的列线上面,即可实现“0”的数字显示。

5 按照右图链接好电路后,就可以开始编写程序了。所有ROW,也就是行的脚都要加220欧电阻
亚博科技 Arduino视频教程 按照右图链接好电路后,就可以开始编写程序了。所有ROW,也就是行的脚都要加220欧电阻

6 亚博科技 Arduino视频教程 参考例程 //the pin to control ROW //arduino 引脚 //led 点阵引脚
const int row1 = 2; // the number of the row pin 9 const int row2 = 3; // the number of the row pin 14 const int row3 = 4; // the number of the row pin 8 const int row4 = 5; // the number of the row pin 12 const int row5 = 17; // the number of the row pin 1 const int row6 = 16; // the number of the row pin 7 const int row7 = 15; // the number of the row pin 2 const int row8 = 14; // the number of the row pin 5 //the pin to control COl const int col1 = 6; // the number of the col pin 13 const int col2 = 7; // the number of the col pin 3 const int col3 = 8; // the number of the col pin 4 const int col4 = 9; // the number of the col pin 10 const int col5 = 10; // the number of the col pin 6 const int col6 = 11; // the number of the col pin 11

7 亚博科技 Arduino视频教程 const int col7 = 12; // the number of the col pin 15
void setup(){ int i = 0 ; for(i=2;i<18;i++) { pinMode(i, OUTPUT); } pinMode(row5, OUTPUT); pinMode(row6, OUTPUT); pinMode(row7, OUTPUT); pinMode(row8, OUTPUT); for(i=2;i<18;i++) { digitalWrite(i, LOW); digitalWrite(row5, LOW); digitalWrite(row6, LOW); digitalWrite(row7, LOW);

8 亚博科技 Arduino视频教程 digitalWrite(row8, LOW); } void loop(){ int i;
//the row # 1 and col # 1 of the LEDs turn on digitalWrite(row1, HIGH); digitalWrite(row2, LOW); digitalWrite(row3, LOW); digitalWrite(row4, LOW); digitalWrite(row5, LOW); digitalWrite(row6, LOW); digitalWrite(row7, LOW); digitalWrite(col1, LOW); digitalWrite(col2, HIGH); digitalWrite(col3, HIGH); digitalWrite(col4, HIGH); digitalWrite(col5, HIGH);

9 亚博科技 Arduino视频教程 digitalWrite(col6, HIGH); digitalWrite(col7, HIGH);
delay(1000); //turn off all for(i=2;i<18;i++) { digitalWrite(i, LOW); }

10 亚博科技 Arduino视频教程 谢谢大家!


Download ppt "亚博科技 Arduino视频教程 第12讲 8乘8点阵."

Similar presentations


Ads by Google