好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

例程12-8乘8点阵精要.ppt

10页
  • 卖家[上传人]:最****
  • 文档编号:117952153
  • 上传时间:2019-12-11
  • 文档格式:PPT
  • 文档大小:322.50KB
  • / 10 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 第12讲 8乘8点阵 亚博科技 Arduino视频教程 亚博科技 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应用时需加限流电阻 8*8点阵介绍 亚博科技 Arduino视频教程 所示是引脚和对应的行列序号,R表示 行,C表示列引脚逆时针排列: 一般我们使用点阵显示汉字是 用的16*16的点阵宋体字库,所谓 16*16,是每一个汉字在纵、横各16 点的区域内显示的。

      也就是说得用四 个8*8点阵组合成一个16*16的点阵如下图所示,要显示“0” 则相应的点就要点亮,由于我们的点阵在列线上是低电平有效 ,而在行线上是高电平有效,所以要显示“0”的话,第一行(9 脚)送0信号,列脚均送1信号依此类推,只要每行数据显示 时间间隔够短,利用人眼的视觉暂停作用,这样送16次数据扫 描完16行后就会看到一个“0” 8*8点阵应用 亚博科技 Arduino视频教程 号依此类推,只要每行数据显示时间间隔够短,利用人眼的 视觉暂停作用,这样送16次数据扫描完16行后就会看到一个“0” ;第二种送数据的方法是字模信号送到行线上再扫描列线也是 同样的道理同样以“0”来说明,16行(9、14、8、12、1、7、 2、5)上送(0000000000000000,0 x00,0 x00)而第一列( 13脚)送、“0”同理扫描第二列当行线上送了16次数据而列 线扫描了16次后一个“0”也就显示出来了因此,形成的列代码 为 00H,00H,3EH,41H,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 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 亚博科技 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;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); 亚博科技 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(col7, HIGH); digitalWrite(col8, HIGH); delay(1000); //turn off all for(i=2;i<18;i++) { digitalWrite(i, LOW); } delay(1000); } 亚博科技 Arduino视频教程 谢谢大家! 。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.