教程课件例程12-8乘8点阵_第1页
教程课件例程12-8乘8点阵_第2页
教程课件例程12-8乘8点阵_第3页
教程课件例程12-8乘8点阵_第4页
教程课件例程12-8乘8点阵_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、。口。矿智宇科技,Arduino视频教程u”。第12讲智宇科技Arduino视频教程8*8点阵介绍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条边,有一边上有丝印,且中间向下有塑

2、料突起;插针向下放置,丝印面向自己,左起为1号脚,逆时针排列。只要其对应的行接高,列接低,即可点亮响应行列的LED。应用时需加限流电阻。智宇科技Arduino视频教程所示是引脚和对应的行列序号,R表示行,C表示列。引脚逆时针排列:8*8点阵应用一般我们使用点阵显示汉字是用的16*16的点阵宋体字库,所谓16*16,是每一个汉字在纵、横各16 点的区域内显示的。也就是说得用四个8*8点阵组合成一个16*16的点阵。如下图所示,要显示“0” 则相应的点就要点亮,由于我们的点阵在列线上是低电平有效, 而在行线上是高电平有效,所以要显示“0”的话,第一行(9脚)送0信号,列脚均送1信号。依此类推,只要

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

4、H,41H,3EH,00H, 00H;只要把这些代码分别依次送到相应的列线上面,即可实现“0”的数字显示。智宇科技Arduino视频教程按照右图链接好电路后,就可以开始编写程序了。所有ROW,也就是行的脚都要加220欧电阻智宇科技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 n

5、umber 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

6、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 pi

7、n 11智宇科技Arduino视频教程const int col7 = 12; / the number of the col pin 15 const int col8 = 13; / the number of the col pin 16 void setup()int i = 0 ; for(i=2;i18;i+)pinMode(i, OUTPUT);pinMode(row5, OUTPUT); pinMode(row6, OUTPUT); pinMode(row7, OUTPUT); pinMode(row8, OUTPUT); for(i=2;i18;i+) digitalWrit

8、e(i, LOW);digitalWrite(row5, LOW); digitalWrite(row6, LOW); digitalWrite(row7, LOW);智宇科技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(row8, LOW); digitalWrite(col1, LOW); digitalWrite(col2, HIGH); digitalWrite(col3, HIGH); digitalWrite(col4, HIGH); digitalWrite(col5, HIGH);智宇科技Arduino视频教程digitalWrite(col6, HIGH); digitalWrite(co

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论