程序参考源代码如下:
#include sbit ST=P3^5; sbit E1=P3^4; sbit MR=P3^7; char cashe[12]; char code wd[12][16]={undefined {0xFF,0xC0,0xFE,0xFE,0xFE,0xFE,0x80,0xFE,0xFD,0xFD,0xFB,0xF7,0xEF,0xDF,0x3F,0xFF}, {0xFF,0x03,0xFF,0xFF,0xFF,0xFF,0x01,0x7F,0x7F,0x7F,0x7F,0x7F,0x7D,0x7D,0x81,0xFF},/“无”,0/ /* (16 X 16 , 宋体 )*/ {0xDF,0xDF,0xDF,0xCF,0x57,0x58,0x5F,0xDF,0xDE,0xDE,0xDE,0xDD,0xDD,0xDB,0xDB,0xD7}, {0x7F,0x6F,0x73,0x77,0x7F,0x01,0x5F,0x5F,0xDF,0xDF,0xDF,0xDF,0xDD,0xDD,0xE1,0xFF},/“忧”,1/ /* (16 X 16 , 宋体 )*/ {0xFE,0xFE,0xFE,0xC0,0xDE,0xDE,0xC0,0xDE,0xDE,0xDE,0xC0,0xDE,0xFE,0xFE,0xFF,0xFF}, {0xFF,0xFF,0xFF,0x07,0xF7,0xF7,0x07,0xF7,0xF7,0xF7,0x07,0xF7,0xFD,0xFD,0x01,0xFF},/“电”,2/ /* (16 X 16 , 宋体 )*/ {0xFF,0xC0,0xFF,0xFF,0xFF,0xFE,0xFE,0xFE,0x00,0xFE,0xFE,0xFE,0xFE,0xFE,0xFA,0xFD}, {0xFF,0x0F,0xDF,0xBF,0x7F,0xFF,0xFF,0xFB,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},/“子”,3/ /* (16 X 16 , 宋体 )*/ {0xFF,0x83,0xBB,0xAB,0xAA,0xAA,0xA9,0xAB,0xAB,0xAA,0xEE,0xD7,0xDB,0xBB,0x7F,0xFF}, {0x7F,0x3F,0x7F,0x01,0xFD,0xFD,0xBD,0xBD,0x5D,0xED,0x05,0xED,0xFD,0xFD,0xEB,0xF7},/“购”,4/ /* (16 X 16 , 宋体 )*/ {0xEF,0xEF,0xAF,0xAE,0x82,0xAD,0x6B,0xEB,0xE6,0xCD,0x2B,0xEF,0xEE,0xED,0xEB,0xFF}, {0x7F,0x7F,0x7F,0x03,0xAB,0xAB,0x6B,0x6B,0xDB,0xDB,0xBB,0x7B,0xFB,0xFB,0xD7,0xEF},/“物”,5/ /* (16 X 16 , 宋体 )*/ }; void del(int i)//============================//延时程序 {while(i–);} aline() =======================发送一行的显示程序 {undefined char i=0; TI=0; for(i=0;i<12;i++) {SBUF=cashe[i];while(~TI);TI=0;} //将缓存中的信息转存入595的存储器中,到此不显示 } main() {undefined int m=0,n=0; TI=0; SM0=0; SM1=0; E1=0; while(1) for(m=0;m<16;m++) //共有16行 循环16次显示这16行 串行的595送出行的数据 { //由74hc154选中要显示的行 for(n=0;n<12;n++) //这个for循环用来向缓存数组中装载要显示的内容 {cashe[11-n]=wd[n][m];} //将第m个字的第n行信息装载 ,因为595串接 数据第一个进去的会在最后一个595中,最后进去的会在第一个595中 aline(); //将缓存中的一行信息载入595缓存中 ST=0;ST=1; //595产生上升沿 输出595锁存的数据 P2=m; //选中要显示的行输出数据 del(100);//延时一段时间,以造成视觉暂存效应 } }
上一篇:4利用移位函数操作点亮流水灯
下一篇:51单片机串口通信数码管显示
推荐阅读最新更新时间:2024-10-23 15:52
设计资源 培训 开发板 精华推荐
- 太阳能追光系统
- LTM4630IY 1.2V 和 1V 输出 DC/DC 稳压器的典型应用电路
- 广达HSEC阵列卡转接板
- AD9266-65EBZ,用于 AD9266BCPZ-65、单通道、16 位、65 MSPS 模数转换器的评估板
- ADP5024 降压稳压器的典型应用电路,具有可调输出电压和精密使能引脚
- 单色 0.91" 128x32 SPI OLED 图形显示器 | 326
- EVAL-AD7865CB,AD7865 评估板,14 位,350KSPS,交流电机 4 通道 ADC
- LT1612、5V 至 3.3V/500mA 转换器
- AM30EW-4815SZ 15V 三路输出 DC/DC 转换器的典型应用
- LM2902EDR2G 双四路滤波器运算放大器的典型应用