LED点阵显示名字
2013-11-25 16:12
211 查看
学习了一周的单片机,然后中途有事打断了两周,现在温习一下之前学的东西,用“普中科技单片机”上的LED点阵显示自己的名字。
P1接J19(绿)、P2接J20(红),P0接J12(数码管段选);5V电压;
显示图片如下:
代码如下:
P1接J19(绿)、P2接J20(红),P0接J12(数码管段选);5V电压;
显示图片如下:
#include <reg52.h> unsigned char code dispbit[] = {0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; //行选通 unsigned char myname[3][8] = { {0x00,0x7f,0x08,0x7f,0x08,0x7f,0x00,0x00}, {0x00,0x3e,0x08,0x7f,0x14,0x22,0x41,0x00}, {0x00,0x3c,0x38,0x10,0x69,0x82,0x00,0x00}}; void main() { int cntx = 0,cnty = 0;//分别行与列 int countx = 0,county = 0; while(1) { P1 = 0xff; P2 = dispbit[cnty]; P0 = myname[cntx][cnty]; //控制动态扫描速度 if(++county >= 50) { county = 0; ++cnty; if(cnty >= 8) cnty = 0; } //控制字符间切换的速度 if( ++countx >= 20000) { countx = 0; ++ cntx; if(cntx >= 3) cntx = 0; } } }
代码如下:
相关文章推荐
- 8*8LED点阵显示爱心的Arduino实现
- uart串口通信控制nxp lpc1114 点阵led显示彩色贪吃蛇源代码。
- 7.4 LED点阵的图形显示
- 在大程序中怎么样显示LED点阵
- 51单片机8*8点阵LED显示原理及程序
- 我的第一个C语言:用点阵显示出我的名字拼音首字母。
- LED点阵书写显示
- 继续树莓派GPIO:两片74HC595控制一个8x8LED点阵显示爱心
- 自己写的一个行扫描led点阵移动显示程序
- LED点阵显示,有关特殊国别(阿拉伯,希伯来,泰文)字符排版和乱码问题解决
- 单片机实验——8X8LED点阵显示技术
- AT89C5X,8*8点阵LED,显示演示代码.
- 8*8LED点阵横向滚动显示
- LED点阵显示
- LED点阵书写显示
- java绘制点阵数字(LED数字显示)
- 单片机实验——8X8LED点阵显示技术(二)
- java绘制点阵数字(LED数字显示),转载源码
- 51单片机LED点阵显示(16*16)源代码
- 继续树莓派GPIO:两片74HC595控制一个8x8LED点阵显示爱心