这是一段64*16的显示屏显示其中74hc595级联原理中的一段程序,然后看不懂这块程序,求大神帮忙解释下

编程题 试卷2_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
编程题 试卷2
上传于||暂无简介
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
下载文档到电脑,查找使用更方便
还剩11页未读,继续阅读
你可能喜欢查看: 516|回复: 3
基于单片机的64*16LED点阵电子显示屏设计 pcb图+原理图+源程序
这是一个51单片机的64*16LED点阵电子显示屏设计包含原理图+pcb图+源程序
0.png (79.91 KB, 下载次数: 15)
03:33 上传
压缩包全部的资料下载:
(8.36 MB, 下载次数: 40)
15:09 上传
点击文件名下载附件
原理图+PCB图+源程序下载积分: 黑币 -5
下面分享一下部分源程序:
/*64*16点阵屏的显示点阵屏的显示*/
#include &reg52.h&
#include &intrins.h&
#include &stdio.h&
#define ulong&&unsigned long
#define uchar unsigned char
#define uint unsigned int
#define DATAOUT P2& && && &&&//指定P2口做为输出
sfr ISP_CONTR = 0xe7;
sbit DATA=DATAOUT^0;& && &&&//列数据输出位& && &&&
sbit SCLH=DATAOUT^1;& && &&&//列扫描时钟位
sbit SCLT=DATAOUT^2;& && &&&//列数据锁存位
sbit AB=DATAOUT^4;& && && && && & //行数据输出位
sbit SCK=DATAOUT^5;& && && && && & //行扫描时钟位& && &&&
sbit key1 = P3^2;& && && && && & //键盘位定义
sbit key2 = P0^1;
sbit key3 = P0^2;
sbit key4 = P3^3;
unsign
unsigned char idata numt0,num,numf,nums,numday,& &//全局变量定义numt0 为定时器0计数,num 为时间秒计数,numf 分钟计数,nums 小时计数
unsigned char idata lhj[128];& && &//128字节RAM做为64*16点阵屏显示缓存
void display();& && && && && && & //做为点阵扫描函数,将显示缓存的数据输出到点阵屏
void display2();
void displayS(unsigned int timer);//指定时间扫描显示
void displayS2(unsigned int );
void displaymove(unsigned char *lp,unsigned char c,unsigned char timer);& && &&&//显示汉字内容的移动效果,LP指向要显示第一个字的首地址,C表示显示字的个数,
void displaymove2(unsigned char *,unsigned char ,unsigned char );& && && && && & //timer是移动的速度
void displaymovetb(unsigned char din,unsigned char *lp,unsigned char c,unsigned char timer);
void displaymovetb2(unsigned char ,unsigned char *,unsigned char ,unsigned char);
void init();& && && && && && && &//初始化函数
void displayshijian();& && && && && && && && & //时间显示函数//上下移动内容,din:1为向下,0为向上,
void displayshijian2();& && && && && && &&&//lp指向要移入的内容表示有几个汉字要移,timer为移动速度& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &
//void delay(unsigned int z);//延时子函数
/******************&&字模&&*************************/
code unsigned char DIAN[32]={
& && &&&0x00,0x00,0x00,0x00,0x1F,0xF8,0x11,0x10,
& && &&&0x11,0x10,0x11,0x10,0x11,0x10,0xFF,0xFE,
& && &&&0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
& && &&&0x1F,0xF9,0x00,0x01,0x00,0x0F,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && && && & //电
code unsigned char QI[32]={
& && &&&0x04,0x00,0x08,0x00,0x32,0x00,0xE2,0x00,
& && &&&0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2A,0x00,
& && &&&0x2A,0x00,0x2A,0x00,0x2A,0x00,0x2B,0xF0,
& && &&&0x20,0x0C,0x20,0x02,0x00,0x0F,0x00,0x00,
& && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && &&&//气
code unsigned char GONG[32]={
& && &&&0x00,0x04,0x20,0x04,0x20,0x04,0x20,0x04,
& && &&&0x20,0x04,0x20,0x04,0x20,0x04,0x3F,0xFC,
& && &&&0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,
& && &&&0x20,0x04,0x20,0x04,0x00,0x04,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && && && &&&//工
code unsigned char CHENG[32]={
& && &&&0x22,0x10,0x22,0x60,0x23,0x80,0x7F,0xFF,
& && &&&0xC2,0x80,0x42,0x60,0x00,0x02,0x7A,0x92,
& && &&&0x42,0x92,0x42,0x92,0x42,0xFE,0x42,0x92,
& && &&&0x42,0x92,0x7A,0x92,0x00,0x82,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && && && &&&//程
code unsigned char LAO[32]={
& & 0x04,0x08,0x04,0x10,0x24,0x20,0x24,0x40,
& && &&&0x24,0xFC,0x24,0xA2,0xFD,0x22,0x26,0x22,
& && &&&0x24,0x42,0x2C,0x42,0x14,0x42,0x24,0x82,
& && &&&0x44,0x1E,0x04,0x00,0x04,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && && &//老
code unsigned char SHI1[32]={
& && && &0x00,0x00,0x3F,0xE1,0x00,0x02,0x00,0x0C,
& && &&&0xFF,0xF0,0x00,0x00,0x40,0x00,0x27,0xF8,
& && &&&0x24,0x00,0x24,0x00,0x7F,0xFF,0x24,0x10,
& && &&&0x24,0x08,0x27,0xF0,0x20,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && & //师
code unsigned char MEN[32]={
& && &&&0x00,0x80,0x01,0x00,0x06,0x00,0x1F,0xFF,
& && &&&0xE0,0x00,0x00,0x00,0x1F,0xFF,0x80,0x00,
& && &&&0x60,0x00,0x00,0x00,0x20,0x00,0x20,0x02,
& && &&&0x20,0x01,0x3F,0xFE,0x00,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && &//们
code unsigned char HAO[32]={
& && &&&0x08,0x02,0x08,0x44,0x0F,0xA8,0xF8,0x10,
& && &&&0x08,0x68,0x0F,0x86,0x00,0x00,0x01,0x00,
& && &&&0x41,0x02,0x41,0x01,0x47,0xFE,0x49,0x00,
& && &&&0x51,0x00,0x61,0x00,0x01,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && & //好
code unsigned char BEI[32] ={
& && &&&0x00,0x04,0x04,0x06,0x04,0x04,0x04,0x08,
& && &&&0x04,0x08,0xFF,0xFF,0x00,0x00,0x00,0x00,
& && &&&0x00,0x00,0xFF,0xFC,0x02,0x02,0x04,0x02,
& && &&&0x08,0x02,0x10,0x02,0x00,0x1E,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && & //北
code unsigned char JING[32] = {
& && &&&0x20,0x00,0x20,0x02,0x20,0x04,0x27,0xD8,
& && &&&0x24,0x40,0x24,0x42,0xA4,0x41,0x64,0x7E,
& && &&&0x24,0x40,0x24,0x40,0x24,0x40,0x27,0xD0,
& && &&&0x20,0x08,0x20,0x06,0x20,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && & //京
code unsigned char SHI[32] = {
& && &&&0x00,0x00,0x3F,0xFC,0x21,0x08,0x21,0x08,
& && &&&0x21,0x08,0x3F,0xFC,0x00,0x00,0x08,0x00,
& && &&&0x08,0x80,0x08,0x60,0x08,0x02,0x08,0x01,
& && &&&0xFF,0xFE,0x08,0x00,0x08,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && & //时
& && && && && && && && && && && && && && && && && && && && && && &
code unsigned char JIAN[32] = {
& && &&&0x00,0x00,0x1F,0xFF,0x80,0x00,0x60,0x00,
& && &&&0x00,0x00,0x0F,0xF8,0x48,0x88,0x48,0x88,
& && &&&0x48,0x88,0x4F,0xF8,0x40,0x00,0x40,0x02,
& && &&&0x40,0x01,0x7F,0xFE,0x00,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && & //间
code unsigned char XL[32]={
& && && && && & 0x00,0x00,0x07,0xc0,0x18,0x30,0x20,0x0C,
& && && && && & 0x40,0xC4,0x8C,0x62,0x8C,0x32,0x80,0x12,
& && && && && & 0x80,0x12,0x80,0x12,0x8C,0x32,0x4C,0x64,
& && && && && & 0x40,0xC4,0x20,0x08,0x18,0x60,0x07,0xC0,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && & //笑脸
code unsigned char ANZHUO[32]={
& && && && && & 0x00,0x00,0x00,0x00,0x03,0xE0,0x03,0xE0,
& && && && && & 0x00,0x00,0x9B,0xF0,0x3B,0xFE,0x6B,0xFE,
& && && && && & 0x7B,0xF0,0x6B,0xFE,0x3B,0xFE,0x9B,0xF0,
& && && && && & 0x00,0x00,0x03,0xE0,0x03,0xE0,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && &//安卓
code unsigned char HOU[32]={
& && && &0x00,0x01,0x00,0x02,0x03,0xfC,0x02,0x30,
& && && &0x02,0x10,0x02,0x18,0xFE,0x16,0x12,0x10,
& && && &0x12,0x18,0x12,0x16,0x12,0x10,0x13,0xf0,
& && && &0x10,0x08,0x10,0x07,0x00,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && &//“点”
code unsigned char MIN[32]={
& && && &0x01,0x00,0x02,0x01,0x04,0x02,0x09,0x04,
& && && &0x11,0x18,0x61,0xE0,0x01,0x00,0x01,0x02,
& && && &0x01,0x01,0xC1,0x02,0x31,0xFC,0x08,0x00,
& && && &0x04,0x00,0x02,0x00,0x01,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && && && && &//“分”
code unsigned char el[32]={
& && && &0x00,0x00,0x07,0x0C,0x10,0x14,0x10,0x24,
& && && &0x10,0x44,0x11,0x84,0x0e,0x0c,0x00,0x00,
& && && &0x00,0x00,0x07,0xe0,0x08,0x10,0x10,0x08,
& && && &0x10,0x08,0x08,0x10,0x07,0xe0,0x00,0x00,};& &//20
code unsigned char yw[32]={
& && && &0x00,0x00,0x08,0x04,0x08,0x04,0x1f,0xfc,
& && && &0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,
& && && &0x00,0x00,0x3e,0x02,0x22,0x02,0x22,0x02,
& && && &0x22,0x04,0x22,0x08,0x21,0xf0,0x00,0x00,};& &//15
code unsigned char NIAN2[32]={
& &&&0x00,0x20,0x04,0x20,0x18,0x20,0xE3,0xE0,
& && && &0x22,0x20,0x22,0x20,0x22,0x20,0x22,0x20,
& && && &0x3F,0xFF,0x22,0x20,0x22,0x20,0x22,0x20,
& && && &0x22,0x20,0x20,0x20,0x00,0x20,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };& && && && && && && && && && && &&&//年
code unsigned char nop[32]={
& &&&0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
& && && &0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
& &&&0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
& && && &0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && && & };&&
code unsigned char lw[32]={
& && && &0x00,0x00,0x07,0xe0,0x08,0x10,0x10,0x08,
& && && &0x10,0x08,0x08,0x10,0x07,0xe0,0x00,0x00,
& && && &0x00,0x00,0x3e,0x02,0x22,0x02,0x22,0x02,
& && && &0x22,0x04,0x22,0x08,0x21,0xf0,0x00,0x00,};& && && &//05
code unsigned char YUE[32]={
& && && &0x00,0x01,0x00,0x02,0x00,0x0C,0x3F,0xF0,
& && && &0x22,0x40,0x22,0x40,0x22,0x40,0x22,0x40,
& && && &0x22,0x40,0x22,0x40,0x22,0x42,0x22,0x41,
& && && &0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && &//月
code unsigned char shl[32]={
& && && &0x00,0x00,0x08,0x04,0x08,0x04,0x1f,0xfc,
& && && &0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,
& && && &0x00,0x00,0x0e,0xf8,0x10,0x84,0x20,0x84,
& && && &0x20,0x84,0x20,0x84,0x20,0x78,0x00,0x00,};& && &&&//16
code unsigned char RI2[32]={
& && && &0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,
& && && &0x41,0x02,0x41,0x02,0x41,0x02,0x41,0x02,
& && && &0x41,0x02,0x41,0x02,0x41,0x02,0x7F,0xFF,
& && && &0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && & //日
code unsigned char xie[32]={
& && && &0x02,0x00,0x42,0x00,0x33,0xFC,0x00,0x08,
& && && &0x00,0x54,0x3F,0xC8,0x6A,0x52,0xAA,0x61,
& && && &0x3F,0xFE,0x01,0x00,0x08,0xC2,0x08,0x01,
& && && &0xFF,0xFE,0x08,0x00,0x08,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};
code unsigned char xie1[32]={
& && && &0x02,0x00,0x42,0x00,0x33,0xFC,0x00,0x08,
& && && &0x00,0x54,0x3F,0xC8,0x6A,0x52,0xAA,0x61,
& && && &0x3F,0xFE,0x01,0x00,0x08,0xC2,0x08,0x01,
& && && &0xFF,0xFE,0x08,0x00,0x08,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};
code unsigned char LAO1[32]={
& & 0x04,0x08,0x04,0x10,0x24,0x20,0x24,0x40,
& && &&&0x24,0xFC,0x24,0xA2,0xFD,0x22,0x26,0x22,
& && &&&0x24,0x42,0x2C,0x42,0x14,0x42,0x24,0x82,
& && &&&0x44,0x1E,0x04,0x00,0x04,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && && &//老
code unsigned char SHI2[32]={
& && && &0x00,0x00,0x3F,0xE1,0x00,0x02,0x00,0x0C,
& && &&&0xFF,0xF0,0x00,0x00,0x00,0x00,0x2f,0xF8,
& && &&&0x28,0x00,0x28,0x00,0x3F,0xFF,0x28,0x10,
& && &&&0x28,0x08,0x2f,0xF0,0x20,0x00,0x00,0x00,
& && && && && && && && && && && && && && && && && && &&&};& && && && && && && && && && && && && && & //师
//时数据
code unsigned char c[3][16]={
///*--&&文字:&&0&&--*//*--&&楷体_GB231212;&&此字体下对应的点阵为:宽x高=8x16& &--*/
{0x00,0x00,0x07,0xe0,0x08,0x10,0x10,0x08,0x10,0x08,0x08,0x10,0x07,0xe0,0x00,0x00,},
{///*--&&文字:&&1&&--*/
0x00,0x00,0x08,0x04,0x08,0x04,0x1f,0xfc,0x00,0x04,0x00,0x04,0x00,0x07,0x10,0x10,},
{///*--&&文字:&&2&&--*/
0x00,0x00,0x07,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0e,0x0c,0x00,0x00,}
};
code unsigned char d[10][16]={
{///*--&&文字:&&0&&--*/
0x00,0x00,0x07,0xe0,0x08,0x10,0x10,0x08,0x10,0x08,0x08,0x10,0x07,0xe0,0x00,0x00,
},
{///*--&&文字:&&1&&--*/
0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,
0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,
},
{///*--&&文字:&&2&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,
},
{///*--&&文字:&&3&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{///*--&&文字:&&4&&--*/
0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,
},
{///*--&&文字:&&5&&--*/
0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{///*--&&文字:&&6&&--*/
0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
},
{///*--&&文字:&&7&&--*/
0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,
},
{///*--&&文字:&&8&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,
},
{///*--&&文字:&&9&&--*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,}
};
//分数据
code unsigned char b[10][16]={
{///*--&&文字:&&0&&--*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
},
{///*--&&文字:&&1&&--*/
0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,
},
{///*--&&文字:&&2&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,
},
{///*--&&文字:&&3&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{///*--&&文字:&&4&&--*/
0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,
},
{///*--&&文字:&&5&&--*/
0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{///*--&&文字:&&6&&--*/
0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
},
{///*--&&文字:&&7&&--*/
0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,
},
{///*--&&文字:&&8&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,
},
{///*--&&文字:&&9&&--*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,
}
};
code unsigned char a[6][16]={
{///*--&&文字:&&0&&--*/
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
},
{///*--&&文字:&&1&&--*/
0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,
},
{///*--&&文字:&&2&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,
},
{///*--&&文字:&&3&&--*/
0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
},
{///*--&&文字:&&4&&--*/
0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,
},
{///*--&&文字:&&5&&--*/
0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,
}
};
void init()& && && && && && && && && && && && && &&&//初始化程序
{
& && &&&TMOD = 0x01;& && && && && && && && && && & //&&定时器0为工作方式1
& && &&&TH0 = ()/256;& && &&&//定时50mS
& && &&&TL0 = ()%256;
& && &&&EA = 1;& && && && && && && && && && && && && &//开总中断
& && &&&ET0 = 1;& && && && && && && && && && && &&&//开定时器0中断
& && &&&EX0 = 1;& && && && && && && && && && && &&&//开外部中断0
& && &&&EX1 = 1;& && && && && && && && && && && &&&//开外部中断1
& && &&&IT0 = 0;& && && && && && && && && && && &&&//设置外部中断0的中断方式为0 低电平触发
& && &&&IT1 = 0;
& && &&&TR0 = 1;& && && && && && && && && && && &&&//启动定时器0
& && &&&num = 0;
& && &&&nums = 12;
& && &&&numf = 30;
& && &&&numyear = 2015;
& && &&&nummonth = 5;
& && &&&numday = 15;
}
void displayshijian()& && && && && &&&//显示时间函数
{
& && && && && & unsigned char i,j,p1,k1,p2,k2;
& && && && && & p1 = nums/10;
& && && && && & k1 = nums%10;& && && & //小时数据
& && && && && & p2 = numf/10;
& && && && && & k2 = numf%10;& && && & //分钟数据
& && && && && &
& && && && && & for(i=0;i&128;i++)& && && &//显示缓存清空& && &&&
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=0;
& && && && && & }
& && && && && & for(i=0,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=c[p1][j];
& && && && && && && && &lhj[i+1]=d[k1][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && &&&
& && && && && & for(i=2,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=HOU[j];
& && && && && && && && &lhj[i+1]=HOU[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && &&&
& && && && && & for(i=4,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=a[p2][j];
& && && && && && && && &lhj[i+1]=b[k2][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && &
& && && && && & for(i=6,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=MIN[j];
& && && && && && && && &lhj[i+1]=MIN[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && && && & displayS(1);& && && &
void displayshijian2()& && && && && &&&//显示时间函数
{
& && && && && &
& && && && && & unsigned char i,j,p1,k1,p2,k2;
& && && && && & p1 = nums/10;
& && && && && & k1 = nums%10;& && && & //小时数据
& && && && && & p2 = numf/10;
& && && && && & k2 = numf%10;& && && & //分钟数据
& && && && && &
& && && && && & for(i=0;i&128;i++)& && && &//显示缓存清空& && &&&
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=0;
& && && && && & }
& && && && && & for(i=0,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=c[p1][j];
& && && && && && && && &lhj[i+1]=d[k1][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && &&&
& && && && && & for(i=2,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=HOU[j];
& && && && && && && && &lhj[i+1]=HOU[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && &&&
& && && && && & for(i=4,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=a[p2][j];
& && && && && && && && &lhj[i+1]=b[k2][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && &
& && && && && & for(i=6,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=MIN[j];
& && && && && && && && &lhj[i+1]=MIN[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && && && & displayS(1);& && && &
}
void displaynyr()& && && && && && && && && && &&&//年月日显示程序
{& && &&&
& && && && && & unsigned char i,j,n1,n2,n3,n4,p1,k1,p2,k2;& && && &//n年 p1k1月 p2k2日
& && && && && & n1 = numyear/1000;
& && && && && & n2 = (numyear%;
& && && && && & n3 = (numyear%100)/10;
& && && && && & n4 = numyear%10;
& && && && && & p1 = nummonth/10;
& && && && && & k1 = nummonth%10;& && && & //月数据
& && && && && & p2 = numday/10;
& && && && && & k2 = numday%10;& && && & //日数据
& && && && && & for(i=0;i&128;i++)& && && &//显示缓存清空& && &&&
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=0;
& && && && && & }
& && && && && & for(i=0,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=d[n1][j];
& && && && && && && && &lhj[i+1]=d[n2][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && & for(i=2,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=d[n3][j];
& && && && && && && && &lhj[i+1]=d[n4][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && & for(i=4,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=NIAN2[j];
& && && && && && && && &lhj[i+1]=NIAN2[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && && && & displayS(2);
& && &&&displaymovetb(1,0,4,2);
& && && && && & for(i=0,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=d[p1][j];
& && && && && && && && &lhj[i+1]=d[k1][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && & for(i=2,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=YUE[j];
& && && && && && && && &lhj[i+1]=YUE[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && && && & for(i=4,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=d[p2][j];
& && && && && && && && &lhj[i+1]=d[k2][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && & for(i=6,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=RI2[j];
& && && && && && && && &lhj[i+1]=RI2[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && &&&displayS(3);
& && & displaymovetb(1,0,4,1);
}
void displaynyr2()
{& && &&&
& && && && && & unsigned char i,j,p1,k1,p2,k2;& && && &//n年 p1k1月 p2k2日
& && && && && & p1 = nummonth/10;
& && && && && & k1 = nummonth%10;& && && & //月数据
& && && && && & p2 = numday/10;
& && && && && & k2 = numday%10;& && && & //日数据
& && && && && & for(i=0,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=d[p1][j];
& && && && && && && && &lhj[i+1]=d[k1][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && & for(i=2,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=YUE[j];
& && && && && && && && &lhj[i+1]=YUE[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && && && & for(i=4,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=d[p2][j];
& && && && && && && && &lhj[i+1]=d[k2][j];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+1;
& && && && && & }
& && && && && & for(i=6,j=0;i&128;)& && && && && &
& && && && && & {& && &&&
& && && && && && && && &lhj[i]=RI2[j];
& && && && && && && && &lhj[i+1]=RI2[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && & }
& && && &&&displayS2(1);
}
void extern1() interrupt 2& && && && && &&&//外部中断1
{
& && &&&displaynyr2();
& && && &if((key2 == 0)&&(key3 ==0))
& && && && && &&&ISP_CONTR = 0x20;
& && && &
& && && &if(key3 == 0)&&
& && &&&{& && &&&
& && && && && & if(key3 == 0)
& && && && && & {
& && && && && && && && &numday++;
& && && && && && && && &if(numday & 31)
& && && && && && && && &&&numday = 1;
& && && && && &&&}
& && &&&}
& && &&&if(key2 == 0)&&
& && &&&{& && &&&
& && && && && & if(key2 == 0)
& && && && && & {
& && && && && && && && &nummonth++;
& && && && && && && && &if(nummonth & 12)
& && && && && && && && && && &&&nummonth = 1;
& && && && && &&&}
& && &&&}
& && &&&key4 = 1;
void extern0() interrupt 0& && && && && &&&//外部中断0
& && && && && & displayshijian2();
& && && && && & if(key2 == 0)& && && && && && && &//key2按键扫描,按下则 小时nums加1
& && && && && & {& && &&&
& && && && && && && && &if(key2 == 0)
& && && && && && && && &{
& && && && && && && && && && &&&nums++;
& && && && && && && && && && &&&if(nums & 23)
& && && && && && && && && && && && && & nums =0;
& && && && && && && && & }
& && && && && & }
& && && && && & if(key3 == 0)& && && && && && && && & //key3按键扫描,按下则 分钟numf加1
& && && && && & {
& && && && && && && && &if(key3 == 0)
& && && && && && && && &{
& && && && && && && && && && &&&numf++;
& && && && && && && && && && &&&if(numf & 59)
& && && && && && && && && && && && && & numf =0;& && && && && &
& && && && && && && && &}
& && && && && & }
& && &&&key1 = 1;& && && && && && & //P3.2口赋高电平 防止下次重复进入中断& && &&&
}
& && &&&
void T0timer() interrupt 1& && && && && && & //定时器0中断
{
& && &&&TH0 = ()/256;
& && &&&TL0 = ()%256;
& && &&&numt0++;
& && &&&if(numt0 &= 40)& && && && && & //24M hz40次为一秒
& && &&&{
& && && && && & numt0 = 0;
& && && && && & num++;
& && && && && & if(num & 59)
& && && && && & {& && &&&num = 0;
& && && && && && && && &numf++;
& && && && && & }
& && &&&}
}
void displaytu_an()
{
& && && &unsigned char i,j;
& && && &for(i=2,j=0;i&128;)& && && && && && && && && && && && && && && && && && &&&//复制笑脸图案到中间
& && && &{& && &&&
& && && && && & lhj[i]=XL[j];
& && && && && & lhj[i+1]=XL[j+1];
& && && && && && &i=i+8;
& && && && && & j=j+2;
& && && && &}
& && && &
& && &&&for(i=4,j=0;i&128;)& && && && && && && && && && && && && && && && && && &&&//复制安卓机器人图案到中间
& && && && && &&&{& && &&&
& && && && && && && && &lhj[i]=ANZHUO[j];
& && && && && && && && &lhj[i+1]=ANZHUO[j+1];
& && &&&
& && && && && && && && &&&i=i+8;
& && && && && && && && &j=j+2;
& && && && && && &&&}
& && && &displayS(4);& && && && && && && && && && && && &&&//显示图案约2秒
void shijianzz()
{
/***************************************************///时间自增
& && &&&if(numf & 59)& && && && && && && && && &//分钟numf,小时nums自增
& && &&&{
& && && && && & numf = 0;
& && && && && & nums++;
& && && && && & if(nums & 23)
& && && && && && && && &{
& && && && && && && && &nums = 0;
& && && && && && && && &numday++;
& && && && && && && && &switch(nummonth)
& && && && && && && && &{
& && && && && && && && &case 1:
& && && && && && && && &case 3:
& && && && && && && && &case 5:
& && && && && && && && &case 7:
& && && && && && && && &case 8:
& && && && && && && && &case 10:
& && && && && && && && &case 12:&&if(numday & 31)
& && && && && && && && && && && && && && && && &{& && &&&nummonth++;
& && && && && && && && && && && && && && && && && && &&&numday=1;
& && && && && && && && && && && && && && && && && && &&&if(nummonth & 12)
& && && && && && && && && && && && && && && && && && && && && & {
& && && && && && && && && && && && && && && && && && && && && &&&nummonth =1;
& && && && && && && && && && && && && && && && && && && && && &&&numyear++;& && &&&
& && && && && && && && && && && && && && && && && && && && && & }
& && && && && && && && && && && && && && && && &};& && &&&
& && && && && && && && && && && && && && && && && && && && && && && && && && && && && &
& && && && && && && && && && && && && && &
& && && && && && && && &case 4:
& && && && && && && && &case 6:
& && && && && && && && &case 9:
& && && && && && && && &case 11:if(numday & 30)
& && && && && && && && && && && && && && && && &{& && &&&nummonth++;
& && && && && && && && && && && && && && && && && && &&&numday=1;
& && && && && && && && && && && && && && && && && && &&&if(nummonth & 12)
& && && && && && && && && && && && && && && && && && && && && & {nummonth =1;
& && && && && && && && && && && && && && && && && && && && && &&&numyear++;
& && && && && && && && && && && && && && && && && && && && && & }
& && && && && && && && && && && && && && && && &};& && &&&
& && && && && && && && && && && && && && && && && && && && && && && && && && && && && &
& && && && && && && && &case 2:& && &&&{
& && && && && && && && && && && && && &&&if(numyear%4==0)
& && && && && && && && && && && && && && && && &if(numday & 29&&)
& && && && && && && && && && && && && && && && &{
& && && && && && && && && && && && && && && && && && &&&nummonth++;
& && && && && && && && && && && && && && && && && && &&&numday=1;
& && && && && && && && && && && && && && && && && && &&&if(nummonth & 12)
& && && && && && && && && && && && && && && && && && && && && & {nummonth = 1;
& && && && && && && && && && && && && && && && && && && && && &&&numyear++;
& && && && && && && && && && && && && && && && && && && && && & }& && &&&
& && && && && && && && && && && && && && && && &}
& && && && && && && && && && && && && &&&else
& && && && && && && && && && && && && && && && &if(numday & 28&&)
& && && && && && && && && && && && && && && && &{
& && && && && && && && && && && && && && && && && && &&&nummonth++;
& && && && && && && && && && && && && && && && && && &&&numday=1;
& && && && && && && && && && && && && && && && && && &&&if(nummonth & 12)
& && && && && && && && && && && && && && && && && && && && && & {nummonth =1;
& && && && && && && && && && && && && && && && && && && && && &&&numyear++;
& && && && && && && && && && && && && && && && && && && && && & }& && &&&
& && && && && && && && && && && && && && && && &}
& && && && && && && && && && && && && & };& && &&&
& && && && && && && && &}
& && && && && && && && &
& && && && && & }
& && &&&}
/*********************************************************/
}
void displayXNKL()
{
& && && && && &&&/*********逐个显示“老师们好”************/& && &&&
& && &&&uchar i,j;
& && &&&for(i=0,j=0;i&128;)& && && && && &
& && &&&{& && &&&
& && && && && & lhj[i]=LAO[j];
& && && && && & lhj[i+1]=LAO[j+1];
& && && && && && &i=i+8;
& && && && && & j=j+2;
& && &&&}
& && &&&displayS(2);
& && &&&
& && &&&for(i=2,j=0;i&128;)& && && && && &
& && &&&{& && &&&
& && && && && & lhj[i]=SHI1[j];
& && && && && & lhj[i+1]=SHI1[j+1];
& && && && && && &i=i+8;
& && && && && & j=j+2;
& && &&&}
& && &&&displayS(2);
& && &&&
& && &&&for(i=4,j=0;i&128;)& && && && && &
& && &&&{& && &&&
& && && && && & lhj[i]=MEN[j];
& && && && && & lhj[i+1]=MEN[j+1];
& && && && && && &i=i+8;
& && && && && & j=j+2;
& && &&&}
& && &&&displayS(2);
& && &&&
& && &&&for(i=6,j=0;i&128;)& && && && && &
& && &&&{& && &&&
& && && && && & lhj[i]=HAO[j];
& && && && && & lhj[i+1]=HAO[j+1];
& && && && && && &i=i+8;
& && && && && & j=j+2;
& && &&&}
& && &&&displayS(2);
/**********************************/& && &&&
/********************** 主函数 *************************************/
void main(void)& && && &&&
{
& && &&&init();& && && && &//初始化程序
& && &&&displaytu_an();
& && &&&displayS(4);& && && && && && &
& && &&&while(1)
& && &&&{
& && && &shijianzz();& && && && && && && && && && && && && & //时间自增函数
& && &&&displaymovetb(1,0,4,3);& && && && && && && && & //向下清屏
& && &&&displaymove(DIAN,4,1);& && && && && && && && &&&//左跑马 “电气工程”
& && &&&displayS(2);
& && &&&displaymovetb(1,0,4,2);& && && && && && && && &//向下卷帘清屏
& && &&&displayXNKL();& && && && && && && && && && && &&&//由左往右显示‘老师们好’
& && &&&displayS(2);
& && &&&displaymove(0,4,2);& && && && && && &&&//左跑马清屏
& && &&&displaymovetb(1,BEI,4,3);& && && && &//向下显示 “北京时间”
& && &&&displayS(2);
& && &&&displaymovetb(0,el,4,1);
& && &&&displayS(2);
& && &&&displaymovetb(1,lw,4,2);
& && &&&displayS(2);
& && &&&displaymove(xie,4,1);
& && &&&displayS(3);
& && &&&displaymovetb(1,0,4,3);& && && && && && && && &//向下清屏
& && &&&displaytu_an();
& && &&&displayS(2);
& && &&&/*displaymovetb(1,0,4,1);
& && &&&displaynyr();& && && && && && && && && && && && &//显示****年**月**日
& && &&&displayshijian();& && && && && && && && && & //调用显示**点**分 时间函数
& && &&&displayS(4000);*/& && && &&&
& && &&&
& && &&&}
}
/********************** 主函数 *************************************/
void display2()& && && && && && &//显示子函数 中断调用才使用
{& && &&&
& && &&&unsigned char i,ia,& && &&&
& && &&&
& && &&&DATAOUT=0XFF;& && && && && && && && && && && && && &
& && &&&AB=0;& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//将行数据位清0,准备移位
& && &&&for(i=0;i&16;i++)
& && &&&{& && && && && &
& && && && && & SCK=0;& && && && && && && && &
& && && && && & SCLT=0;& && && && && && && && &
& && && && && & for(ia=8;ia&0;)
& && && && && & {& && && && && && && && && && && && && && && && &//每行64个点,循环位移8个字节
& && && && && & ia--;& && && && && && && && && && && && && && && && && && && && && && && && &//循环四次
& && && && && &&&tmp=~lhj[i*8+ia];& && &&&
& && && && && && && && &for(j=0;j&8;j++)
& && && && && && && && &{& && && && && && && && && && && && && && && && &//循环两次,每次移一个字节,
& && && && && && && && && && &&&SCLH=0;& && && && && && && && &
& && && && && && && && && &&&DATA=tmp&0x01;& && && && && && && && && && && && && && && &//将数据低位做输出
& && && && && && && && && && &&&tmp&&=1;& && && &
& && && && && && && && && &&&SCLH=1;& && && && && && && && && && && && && && && && && && && && && & //将DATA上的数据移入寄存器
& && && && && && && && &}& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//移入单字节结束
& && && && && & }& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//移入两个字节结束
& && && && && & DATAOUT|=0X24;& && &&&
& && && && && & //等价于SCK=1;& && && && && &
& && && && && & //& && &SCLT=1;& && && && && &
& && && && && & AB=1;& && && && && &
& && &&&}
& && &&&j=100;
& && &&&while(j--);& && && && && && && && && && && && && && &//每一行的显示,保持6个字节的移位时间,因此,最后一行的显示,也要加入保持时间,补尝显示的亮度
& && &&&SCK=0;& && && && && && && && && && && && && && && && &&&
& && &&&SCK=1;& && && && && && && && && && && && && && && && &&&//将最后一行数据移出
}
void display()& && && && && && && && && && && && && && && &//显示子函数
{& && &&&
& && &&&unsigned char i,ia,& && &&&
& && &&&
& && &&&DATAOUT=0XFF;& && && && && && && && && && && && && &
& && &&&AB=0;& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//将行数据位清0,准备移位
& && &&&for(i=0;i&16;i++)
& && &&&{& && && && && &
& && && && && & SCK=0;& && && && && && && && &
& && && && && & SCLT=0;& && && && && && && && &
& && && && && & for(ia=8;ia&0;)
& && && && && & {& && && && && && && && && && && && && && && && &//每行64个点,循环位移8个字节
& && && && && & ia--;& && && && && && && && && && && && && && && && && && && && && && && && &//循环四次
& && && && && &&&tmp=~lhj[i*8+ia];& && &&&
& && && && && && && && &for(j=0;j&8;j++)
& && && && && && && && &{& && && && && && && && && && && && && && && && &//循环两次,每次移一个字节,
& && && && && && && && && && &&&SCLH=0;& && && && && && && && &
& && && && && && && && && &&&DATA=tmp&0x01;& && && && && && && && && && && && && && && &//将数据低位做输出
& && && && && && && && && && &&&tmp&&=1;& && && &
& && && && && && && && && &&&SCLH=1;& && && && && && && && && && && && && && && && && && && && && & //将DATA上的数据移入寄存器
& && && && && && && && &}& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//移入单字节结束
& && && && && & }& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//移入两个字节结束
& && && && && & DATAOUT|=0X24;& && &&&
& && && && && & //等价于SCK=1;& && && && && &
& && && && && & //& && &SCLT=1;& && && && && &
& && && && && & AB=1;& && && && && &
& && &&&}
& && &&&j=100;
& && &&&while(j--);& && && && && && && && && && && && && && &//每一行的显示,保持6个字节的移位时间,因此,最后一行的显示,也要加入保持时间,补尝显示的亮度
& && &&&SCK=0;& && && && && && && && && && && && && && && && &&&
& && &&&SCK=1;& && && && && && && && && && && && && && && && &&&//将最后一行数据移出
}
void displayS2(unsigned int timer)& && && && && && & //指定时间扫描显示函数 中断调用时用
{
& && &&&& && &&&
& && &&&while(timer--)
& && &&&{& && && && && && && && && && && & //当timer=1时,大约1秒时间
& && && && && & i=20;& && && && && &
& && && && && & while(i--)
& && && && && && && && &display2();
& && &&&}
}
void displayS(unsigned int timer)& && && && &//指定时间扫描显示函数
{
& && &&&& && &&&
& && &&&while(timer--)
& && &&&{& && && && && && && && && && && & //当timer=1时,大约1秒时间
& && && && && & i=20;& && && && && &
& && && && && & while(i--)
& && && && && && && && &display();
& && &&&}
}
void displaymove(unsigned char *lp,unsigned char c,unsigned char timer)//左移显示函数,LP指向要显示第一个字的首地址,C表示显示字的个数,
& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &//timer是移动的速度
{
& && &&&unsigned char i=0,j=0,ia=0;
& && &&&unsigned int tmp=0,timerc=0;
& && &&&unsigned char tmp2[16];
& && &&&c*=2;& && && && && &
& && &&&for(i=0;i&16;i++)
& && && && && & tmp2[i]=0;& && && && && && && && && && && && && && &&&//将缓冲区清0,
& && &&&while(c)
& && &&&{
& && && && && & if(lp!=0)
& && && && && & {& && && && && && && && && && && && && && &&&//当lp指向的地址为0时,直接用组缓冲0补上,效果是将当前显示的内容移出
& && && && && & tmp=c%2;& && && && && && && && && && && && && && && && && && && && && && && && &//取余,目的是为了判断处理汉字的前半部份还是后半部份
& && && && && & for(i=0;i&16;i++)
& && && && && && && && &{& && && && && &
& && && && && && && && && && &&&tmp2[i]=lp[i*2+tmp];& && && && && && && && && && && && && & //取半个汉字点阵数据,16字节
& && && && && && && && &}
& && && && && & if(tmp)& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//当tmp为1时,表时一个字数组处理完成,将地址转到下一个字
& && && && && && && && &lp+=32;
& && && && && & }
& && && && && & //--------------
& && && && && & tmp=8;& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//变量再次利用
& && && && && & while(tmp)
& && && && && & {& && && && && && && && && && && && && && && && && && && && && && && && &//循环8次,是将下一个字的前半部份的字节数据移入显示缓冲& && &&&
& && && && && & ia=0;& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//做为点阵数组的元素
& && && && && & for(i=0;i&16;i++)
& && && && && & {& && && && && && && && && && && && && && && && && && &&&//移动是16行同时移,因此要处理16个字节
& && && && && && && && &for(j=0;j&7;j++)
& && && && && && && && &{& && && && && && && && && && && && && && && && &//一行32个点四字节,有三字节在显示缓冲中移动
& && && && && && && && && && &&&lhj[ia]&&=1;& && && && && && && && && && && && && && && && &//移当前显示缓冲的半行字节
& && && && && && && && && && &&&if(lhj[ia+1]&0x80)& && && && && && && && && && && && && & //判断后半行字节的高位是否为1,是移入前半行字节低位,否则不处理
& && && && && && && && && && && && && & lhj[ia]++;
& && && && && && && && && && &&&ia++;
& && && && && && && && &}
& && && && && && && && &lhj[ia]&&=1;& && && && && && && && && && && && && && && && && && &&&//一行32个点四字节,将最后一字节用下一个字补上
& && && && && && && && &if(tmp2[i]&0x80)& && && && && && && && && && && && && && && && &//判断下一个要显示汉字的前半行字节的高位是否为1,是移入,否则不处理
& && && && && && && && && && &&&lhj[ia]++;
& && && && && && && && &ia++;
& && && && && && && && &tmp2[i]&&=1;& && && && && && && && && && && && && && && && && && &&&//下一个要显示汉字的半行字节向高位移一位,准备下一次取位
& && && && && & }
& && && && && & tmp--;
& && && && && & timerc=& && && && && && && && && && && && && && && && && && && && && & //处理完16行,调用显示函数更新点阵
& && && && && & while(timerc--)& && && && && && && && && && && && && && && && && && && && && && && && &//循环做为处理的速度,即移动的速度
& && && && && && && && &display();
& && && && && & }
& && && && && & //----------
& && && && && & c--;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //移完一半,进入下一半或下一个汉字,直到结束
& && &&&}
}
void displaymove2(unsigned char *lp,unsigned char c,unsigned char timer)//左移显示函数,LP指向要显示第一个字的首地址,C表示显示字的个数,
& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &//timer是移动的速度
{
& && &&&unsigned char i=0,j=0,ia=0;
& && &&&unsigned int tmp=0,timerc=0;
& && &&&unsigned char tmp2[16];
& && &&&c*=2;& && && && && &
& && &&&for(i=0;i&16;i++)
& && && && && & tmp2[i]=0;& && && && && && && && && && && && && && &&&//将缓冲区清0,
& && &&&while(c)
& && &&&{
& && && && && & if(lp!=0)
& && && && && & {& && && && && && && && && && && && && && &&&//当lp指向的地址为0时,直接用组缓冲0补上,效果是将当前显示的内容移出
& && && && && & tmp=c%2;& && && && && && && && && && && && && && && && && && && && && && && && &//取余,目的是为了判断处理汉字的前半部份还是后半部份
& && && && && & for(i=0;i&16;i++)
& && && && && && && && &{& && && && && &
& && && && && && && && && && &&&tmp2[i]=lp[i*2+tmp];& && && && && && && && && && && && && & //取半个汉字点阵数据,16字节
& && && && && && && && &}
& && && && && & if(tmp)& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//当tmp为1时,表时一个字数组处理完成,将地址转到下一个字
& && && && && && && && &lp+=32;
& && && && && & }
& && && && && & //--------------
& && && && && & tmp=8;& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//变量再次利用
& && && && && & while(tmp)
& && && && && & {& && && && && && && && && && && && && && && && && && && && && && && && &//循环8次,是将下一个字的前半部份的字节数据移入显示缓冲& && &&&
& && && && && & ia=0;& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//做为点阵数组的元素
& && && && && & for(i=0;i&16;i++)
& && && && && & {& && && && && && && && && && && && && && && && && && &&&//移动是16行同时移,因此要处理16个字节
& && && && && && && && &for(j=0;j&7;j++)
& && && && && && && && &{& && && && && && && && && && && && && && && && &//一行32个点四字节,有三字节在显示缓冲中移动
& && && && && && && && && && &&&lhj[ia]&&=1;& && && && && && && && && && && && && && && && &//移当前显示缓冲的半行字节
& && && && && && && && && && &&&if(lhj[ia+1]&0x80)& && && && && && && && && && && && && & //判断后半行字节的高位是否为1,是移入前半行字节低位,否则不处理
& && && && && && && && && && && && && & lhj[ia]++;
& && && && && && && && && && &&&ia++;
& && && && && && && && &}
& && && && && && && && &lhj[ia]&&=1;& && && && && && && && && && && && && && && && && && &&&//一行32个点四字节,将最后一字节用下一个字补上
& && && && && && && && &if(tmp2[i]&0x80)& && && && && && && && && && && && && && && && &//判断下一个要显示汉字的前半行字节的高位是否为1,是移入,否则不处理
& && && && && && && && && && &&&lhj[ia]++;
& && && && && && && && &ia++;
& && && && && && && && &tmp2[i]&&=1;& && && && && && && && && && && && && && && && && && &&&//下一个要显示汉字的半行字节向高位移一位,准备下一次取位
& && && && && & }
& && && && && & tmp--;
& && && && && & timerc=& && && && && && && && && && && && && && && && && && && && && & //处理完16行,调用显示函数更新点阵
& && && && && & while(timerc--)& && && && && && && && && && && && && && && && && && && && && && && && &//循环做为处理的速度,即移动的速度
& && && && && && && && &display2();
& && && && && & }
& && && && && & //----------
& && && && && & c--;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //移完一半,进入下一半或下一个汉字,直到结束
& && &&&}
}
void displaymovetb(unsigned char din,unsigned char *lp,unsigned char c,unsigned char timer)
//上下移动显示函数,din:1为向下,0为向上,lp指向要移入的内容,C表示有几个汉字要移,timer为移动速度
{
& && &&&unsigned char i=0,j=0,ia=0,ib=0,ic=0,id=0;
& && &&&unsigned int tmp=0,timerc=0;
& && &&&if(din)
& && &&&{& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//判断移动方向,向下
& && &&&ia=32;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//要移入第一个汉字的数组元素
& && &&&ib=64;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//要移入第二个汉字的数组元素
& && &&&ic=96;
& && &&&id=128;
& && &&&i=16;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//行索引
& && &&&while(i--)
& && &&&{& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //逐行处理
& && && && && && &j=120;
& && && && && & while(j)
& && && && && & {
& && && && && && && && &j--;
& && && && && && && && &lhj[j+8]=lhj[j];& && && && && && && && && && && && && && && && && && && && && & //将上一行的内容复制到下一行,每两行内容相隔6个字节,复制15行
& && && && && & }
& && && && && & if(lp==0)
& && && && && & {& && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //最后一行的处理,判断移入的内容是否为空,是用0移入
& && && && && && && && &j=8;
& && && && && && && && &while(j--)
& && && && && && && && && && &&&lhj[j]=0;
& && && && && & }
& && && && && & else
& && && && && & {& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &//否则,取字数组处理
& && && && && && && && &ia--;ib--;ic--;id--& && &&&;
& && && && && && && && &if(c==4)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//判断4个字,移一行,6个字节
& && && && && && && && &lhj[1]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[0]=lp[ia];
& && && && && && && && &lhj[3]=lp[ib];
& && && && && && && && &ib--;
& && && && && && && && &lhj[2]=lp[ib];
& && && && && && && && &lhj[5]=lp[ic];
& && && && && && && && &ic--;
& && && && && && && && &lhj[4]=lp[ic];
& && && && && && && && &lhj[7]=lp[id];
& && && && && && && && &id--;
& && && && && && && && &lhj[6]=lp[id];
& && && && && && && && &}
& && && && && && && && &else if(c==3)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则3个字,将字放在中间,旁边补0
& && && && && && && && &lhj[0]=0;
& && && && && && && && &lhj[2]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[1]=lp[ia];
& && && && && && && && &lhj[4]=lp[ib];
& && && && && && && && &ib--;
& && && && && && && && &lhj[3]=lp[ib];
& && && && && && && && &lhj[6]=lp[ic];
& && && && && && && && &ic--;
& && && && && && && && &lhj[5]=lp[ic];
& && && && && && && && &lhj[7]=0;
& && && && && && && && &}
& && && && && && && && &else if(c==2)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则2个字,将字放在中间,旁边补0
& && && && && && && && &lhj[0]=0;
& && && && && && && && &lhj[1]=0;
& && && && && && && && &lhj[3]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[2]=lp[ia];
& && && && && && && && &lhj[5]=lp[ib];
& && && && && && && && &ib--;
& && && && && && && && &lhj[4]=lp[ib];& && && && && && && && &
& && && && && && && && &lhj[6]=0;
& && && && && && && && & lhj[7]=0;
& && && && && && && && &}
& && && && && && && && &else if(c==1)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则1个字,将字放在中间,旁边补0
& && && && && && && && &lhj[0]=0;
& && && && && && && && &lhj[1]=0;
& && && && && && && && & lhj[2]=0;
& && && && && && && && &lhj[4]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[3]=lp[ia];
& && && && && && && && &lhj[5]=0;& && &&&
& && && && && && && && &lhj[6]=0;
& && && && && && && && &lhj[7]=0;
& && && && && && && && &}
& && && && && & }
& && && && && & timerc=& && && && && && && && && && && && && && && && && && && && && & //处理完16行,调用显示函数更新点阵
& && && && && & while(timerc--)& && && && && && && && && && && && && && && && && && && && && & //循环做为处理的速度,即移动的速度
& && && && && && && && &display();
& && &&&}
& && &&&}
& && &&&else
& && &&&{& && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //移动方向,向上
& && &&&ia=0;ib=32;ic=64;id=96;& && && && && && && && && && && && && && && && && && &&&//向上移动,移入汉字从低位开始
& && && && && & for(i=0;i&16;i++)
& && && && && & {& && && && && && && && && && && && && && && && && && &&&//处理16行
& && && && && && && && &for(j=0;j&120;j++)& && && && && && && && && && && && && && && && &//将下一行的内容复制到上一行,每两行内容相隔6个字节,复制15行
& && && && && && && && && && &&&lhj[j]=lhj[j+8];
& && && && && && && && &if(lp==0)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //最后一行的处理,判断移入的内容是否为空,是用0移入
& && && && && && && && && && &&&while(j!=128)
& && && && && && && && && && &&&{
& && && && && && && && && && && && && & lhj[j]=0;
& && && && && && && && && && && && && & j++;
& && && && && && && && && && && &&&}
& && && && && && && && &}
& && && && && && && && &else
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && && && &//否则,取字数组处理
& && && && && && && && &if(c==4)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && &//判断4个字,移一行,8个字节& && && && && && && && && && && && && &
& && && && && && && && && && &&&lhj[120]=lp[ia];
& && && && && && && && && && &&&lhj[121]=lp[ia+1];
& && && && && && && && && && &&&lhj[122]=lp[ib];
& && && && && && && && && && &&&lhj[123]=lp[ib+1];
& && && && && && && && && && &&&lhj[124]=lp[ic];
& && && && && && && && && && &&&lhj[125]=lp[ic+1];
& && && && && && && && && && && &lhj[126]=lp[id];
& && && && && && && && && && && &lhj[127]=lp[id+1];
& && && && && && && && && && &&&ia+=2;ib+=2;ic+=2;id+=2;& && && && && && && && && &
& && && && && && && && &}
& && && && && && && && &else if(c==3)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && &&&//否则3个字,将字放在中间,旁边补0
& && && && && && && && && && &&&lhj[120]=0;
& && && && && && && && && && &&&lhj[121]=lp[ia];
& && && && && && && && && && &&&lhj[122]=lp[ia+1];
& && && && && && && && && && &&&lhj[123]=lp[ib];
& && && && && && && && && && &&&lhj[124]=lp[ib+1];
& && && && && && && && && && &&&lhj[125]=lp[ic];
& && && && && && && && && && &&&lhj[126]=lp[ic+1];
& && && && && && && && && && &&&lhj[127]=0;
& && && && && && && && && && &&&ia+=2;ib+=2;ic+=2;
& && && && && && && && &}
& && && && && && && && &else if(c==2)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则2个字,将字放在中间,旁边补0
& && && && && && && && && && &&&lhj[120]=0;
& && && && && && && && && && &&&lhj[121]=0;
& && && && && && && && && && &&&lhj[122]=lp[ia];
& && && && && && && && && && &&&lhj[123]=lp[ia+1];
& && && && && && && && && && &&&lhj[124]=lp[ib];
& && && && && && && && && && &&&lhj[125]=lp[ib+1];
& && && && && && && && && && &&&lhj[126]=0;
& && && && && && && && && && &&&lhj[127]=0;
& && && && && && && && && && &&&ia+=2;ib+=2;
& && && && && && && && &}
& && && && && && && && &else
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//判断1个字,移一行,8个字节,将字放在中间,两边补0
& && && && && && && && && && &&&lhj[120]=0;
& && && && && && && && && && &&&lhj[121]=0;
& && && && && && && && && && &&&lhj[122]=0;
& && && && && && && && && && &&&lhj[123]=lp[ia];
& && && && && && && && && && &&&ia++;
& && && && && && && && && && &&&lhj[124]=lp[ia];
& && && && && && && && && && &&&ia++;
& && && && && && && && && && &&&lhj[125]=0;
& && && && && && && && && && &&&lhj[126]=0;
& && && && && && && && && && &&&lhj[127]=0;
& && && && && && && && & }
& && && && && && && && &}
& && && && && & timerc=& && && && && && && && && && && && && && && && && && && && && & //处理完16行,调用显示函数更新点阵
& && && && && & while(timerc--)& && && && && && && && && && && && && && && && && && && && && & //循环做为处理的速度,即移动的速度
& && && && && && && && &display();
& && && && && && & }
& && && &&&}
& && && && && && && && &
}
void displaymovetb2(unsigned char din,unsigned char *lp,unsigned char c,unsigned char timer)
//上下移动显示函数,din:1为向下,0为向上,lp指向要移入的内容,C表示有几个汉字要移,timer为移动速度
{
& && &&&unsigned char i=0,j=0,ia=0,ib=0,ic=0,id=0;
& && &&&unsigned int tmp=0,timerc=0;
& && &&&if(din)
& && &&&{& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//判断移动方向,向下
& && &&&ia=32;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//要移入第一个汉字的数组元素
& && &&&ib=64;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//要移入第二个汉字的数组元素
& && &&&ic=96;
& && &&&id=128;
& && &&&i=16;& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &&&//行索引
& && &&&while(i--)
& && &&&{& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //逐行处理
& && && && && && &j=120;
& && && && && & while(j)
& && && && && & {
& && && && && && && && &j--;
& && && && && && && && &lhj[j+8]=lhj[j];& && && && && && && && && && && && && && && && && && && && && & //将上一行的内容复制到下一行,每两行内容相隔6个字节,复制15行
& && && && && & }
& && && && && & if(lp==0)
& && && && && & {& && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //最后一行的处理,判断移入的内容是否为空,是用0移入
& && && && && && && && &j=8;
& && && && && && && && &while(j--)
& && && && && && && && && && &&&lhj[j]=0;
& && && && && & }
& && && && && & else
& && && && && & {& && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && && &//否则,取字数组处理
& && && && && && && && &ia--;ib--;ic--;id--& && &&&;
& && && && && && && && &if(c==4)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//判断4个字,移一行,6个字节
& && && && && && && && &lhj[1]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[0]=lp[ia];
& && && && && && && && &lhj[3]=lp[ib];
& && && && && && && && &ib--;
& && && && && && && && &lhj[2]=lp[ib];
& && && && && && && && &lhj[5]=lp[ic];
& && && && && && && && &ic--;
& && && && && && && && &lhj[4]=lp[ic];
& && && && && && && && &lhj[7]=lp[id];
& && && && && && && && &id--;
& && && && && && && && &lhj[6]=lp[id];
& && && && && && && && &}
& && && && && && && && &else if(c==3)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则3个字,将字放在中间,旁边补0
& && && && && && && && &lhj[0]=0;
& && && && && && && && &lhj[2]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[1]=lp[ia];
& && && && && && && && &lhj[4]=lp[ib];
& && && && && && && && &ib--;
& && && && && && && && &lhj[3]=lp[ib];
& && && && && && && && &lhj[6]=lp[ic];
& && && && && && && && &ic--;
& && && && && && && && &lhj[5]=lp[ic];
& && && && && && && && &lhj[7]=0;
& && && && && && && && &}
& && && && && && && && &else if(c==2)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则2个字,将字放在中间,旁边补0
& && && && && && && && &lhj[0]=0;
& && && && && && && && &lhj[1]=0;
& && && && && && && && &lhj[3]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[2]=lp[ia];
& && && && && && && && &lhj[5]=lp[ib];
& && && && && && && && &ib--;
& && && && && && && && &lhj[4]=lp[ib];& && && && && && && && &
& && && && && && && && &lhj[6]=0;
& && && && && && && && & lhj[7]=0;
& && && && && && && && &}
& && && && && && && && &else if(c==1)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则1个字,将字放在中间,旁边补0
& && && && && && && && &lhj[0]=0;
& && && && && && && && &lhj[1]=0;
& && && && && && && && & lhj[2]=0;
& && && && && && && && &lhj[4]=lp[ia];
& && && && && && && && &ia--;
& && && && && && && && &lhj[3]=lp[ia];
& && && && && && && && &lhj[5]=0;& && &&&
& && && && && && && && &lhj[6]=0;
& && && && && && && && &lhj[7]=0;
& && && && && && && && &}
& && && && && & }
& && && && && & timerc=& && && && && && && && && && && && && && && && && && && && && & //处理完16行,调用显示函数更新点阵
& && && && && & while(timerc--)& && && && && && && && && && && && && && && && && && && && && & //循环做为处理的速度,即移动的速度
& && && && && && && && &display();
& && &&&}
& && &&&}
& && &&&else
& && &&&{& && && && && && && && && && && && && && && && && && && && && && && && && && && && && & //移动方向,向上
& && &&&ia=0;ib=32;ic=64;id=96;& && && && && && && && && && && && && && && && && && &&&//向上移动,移入汉字从低位开始
& && && && && & for(i=0;i&16;i++)
& && && && && & {& && && && && && && && && && && && && && && && && && &&&//处理16行
& && && && && && && && &for(j=0;j&120;j++)& && && && && && && && && && && && && && && && &//将下一行的内容复制到上一行,每两行内容相隔6个字节,复制15行
& && && && && && && && && && &&&lhj[j]=lhj[j+8];
& && && && && && && && &if(lp==0)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //最后一行的处理,判断移入的内容是否为空,是用0移入
& && && && && && && && && && &&&while(j!=128)
& && && && && && && && && && &&&{
& && && && && && && && && && && && && & lhj[j]=0;
& && && && && && && && && && && && && & j++;
& && && && && && && && && && && &&&}
& && && && && && && && &}
& && && && && && && && &else
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && && && &//否则,取字数组处理
& && && && && && && && &if(c==4)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && &//判断4个字,移一行,8个字节& && && && && && && && && && && && && &
& && && && && && && && && && &&&lhj[120]=lp[ia];
& && && && && && && && && && &&&lhj[121]=lp[ia+1];
& && && && && && && && && && &&&lhj[122]=lp[ib];
& && && && && && && && && && &&&lhj[123]=lp[ib+1];
& && && && && && && && && && &&&lhj[124]=lp[ic];
& && && && && && && && && && &&&lhj[125]=lp[ic+1];
& && && && && && && && && && && &lhj[126]=lp[id];
& && && && && && && && && && && &lhj[127]=lp[id+1];
& && && && && && && && && && &&&ia+=2;ib+=2;ic+=2;id+=2;& && && && && && && && && &
& && && && && && && && &}
& && && && && && && && &else if(c==3)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && &&&//否则3个字,将字放在中间,旁边补0
& && && && && && && && && && &&&lhj[120]=0;
& && && && && && && && && && &&&lhj[121]=lp[ia];
& && && && && && && && && && &&&lhj[122]=lp[ia+1];
& && && && && && && && && && &&&lhj[123]=lp[ib];
& && && && && && && && && && &&&lhj[124]=lp[ib+1];
& && && && && && && && && && &&&lhj[125]=lp[ic];
& && && && && && && && && && &&&lhj[126]=lp[ic+1];
& && && && && && && && && && &&&lhj[127]=0;
& && && && && && && && && && &&&ia+=2;ib+=2;ic+=2;
& && && && && && && && &}
& && && && && && && && &else if(c==2)
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && & //否则2个字,将字放在中间,旁边补0
& && && && && && && && && && &&&lhj[120]=0;
& && && && && && && && && && &&&lhj[121]=0;
& && && && && && && && && && &&&lhj[122]=lp[ia];
& && && && && && && && && && &&&lhj[123]=lp[ia+1];
& && && && && && && && && && &&&lhj[124]=lp[ib];
& && && && && && && && && && &&&lhj[125]=lp[ib+1];
& && && && && && && && && && &&&lhj[126]=0;
& && && && && && && && && && &&&lhj[127]=0;
& && && && && && && && && && &&&ia+=2;ib+=2;
& && && && && && && && &}
& && && && && && && && &else
& && && && && && && && &{& && && && && && && && && && && && && && && && && && && && && && && && && && &&&//判断1个字,移一行,8个字节,将字放在中间,两边补0
& && && && && && && && && && &&&lhj[120]=0;
& && && && && && && && && && &&&lhj[121]=0;
& && && && && && && && && && &&&lhj[122]=0;
& && && && && && && && && && &&&lhj[123]=lp[ia];
& && && && && && && && && && &&&ia++;
& && && && && && && && && && &&&lhj[124]=lp[ia];
& && && && && && && && && && &&&ia++;
& && && && && && && && && && &&&lhj[125]=0;
& && && && && && && && && && &&&lhj[126]=0;
& && && && && && && && && && &&&lhj[127]=0;
& && && && && && && && & }
& && && && && && && && &}
& && && && && & timerc=& && && && && && && && && && && && && && && && && && && && && & //处理完16行,调用显示函数更新点阵
& && && && && & while(timerc--)& && && && && && && && && && && && && && && && && && && && && & //循环做为处理的速度,即移动的速度
& && && && && && && && &display();
& && && && && && & }
& && && &&&}& && && && && && && && &
}
复制代码
共享资料的黑币奖励!
 欢饮大家下载
无效楼层,该帖已经被删除
这个设计很不错,51黑有你更精彩!!!
新手学习了
Powered by

我要回帖

更多关于 74hc595级联 的文章

 

随机推荐