点阵实时移动+汉显
时间:10-02
整理:3721RD
点击:
/*************************************************
* 点阵字码表table1 **
* 用于移屏显示 **
**************************************************/
unsigned long int code table1[][16]={
{0xFC,0x3F,0xFE,0x7F,0x06,0x60,0x06,0x60,0x06,0x60,0xFE,0x7F,0xFC,0x3F,0x00,0x00}, //0
{0x00,0x00,0x08,0x40,0x08,0x60,0xFE,0x7F,0xFE,0x7F,0x00,0x60,0x00,0x40,0x00,0x00}, //1
{0x0C,0x78,0x06,0x7C,0x06,0x66,0x06,0x63,0x86,0x61,0xFE,0x70,0x7C,0x70,0x00,0x00},//2
{0x0C,0x30,0x06,0x60,0x82,0x60,0x82,0x60,0xC2,0x61,0x7E,0x3F,0x3C,0x1E,0x00,0x00}, //3
{0xE0,0x0F,0xF0,0x0F,0x18,0x4C,0x0C,0x4C,0xFE,0x7F,0xFE,0x7F,0x00,0x4C,0x00,0x00}, //4
{0xFE,0x30,0xFE,0x60,0xC2,0x60,0xC2,0x60,0xC2,0x61,0x82,0x3F,0x02,0x1F,0x00,0x00}, //5
{0xFC,0x3F,0xFE,0x7F,0x82,0x61,0x82,0x61,0x82,0x61,0x8E,0x7F,0x0C,0x3F,0x00,0x00}, //6
{0x0E,0x00,0x0E,0x00,0x02,0x00,0xC2,0x7F,0xE2,0x7F,0x3E,0x00,0x1E,0x00,0x00,0x00}, //7
{0x7C,0x3C,0xFE,0x7E,0x86,0x63,0x86,0x63,0x86,0x63,0xFE,0x7E,0x7C,0x3C,0x00,0x00}, //8
{0xFC,0x30,0xFE,0x61,0x86,0x61,0x86,0x61,0x86,0x61,0xFE,0x7F,0xFC,0x3F,0x00,0x00}, //9
{0x00,0x00,0x00,0x00,0x38,0x1C,0x3C,0x3C,0x3C,0x3C,0x38,0x1C,0x00,0x00,0x00,0x00}, //10 :
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //11空
{0x00,0x00,0x00,0x00,0x40,0x20,0x42,0x22,0x5E,0x22,0x5C,0x22,0x48,0x22,0x40,0x22},
{0x7F,0x22,0x7F,0x22,0x50,0x22,0x5E,0x22,0x4E,0x22,0xC4,0x7F,0xC0,0x7F,0x00,0x00},//"当",12\13/
{0x08,0x00,0x08,0x00,0xE8,0x7F,0xE8,0x7F,0xA9,0x24,0xAF,0x64,0xEE,0x7F,0xEA,0x3F},
{0x08,0x00,0xC8,0x1F,0xCC,0x5F,0x0F,0xC0,0xEB,0xFF,0xEA,0x7F,0x08,0x00,0x08,0x00},//"前",14\15/
{0x00,0x00,0xFC,0x07,0xFC,0x07,0x44,0x04,0x44,0x04,0xFC,0x07,0xFC,0x07,0x90,0x00},
{0x90,0x03,0x10,0x43,0x10,0xC0,0xFF,0xFF,0xFF,0x7F,0x10,0x00,0x10,0x00,0x10,0x00},//"时",16\17/
{0x00,0x00,0xF8,0xFF,0xF9,0xFF,0x07,0x00,0x06,0x00,0xF0,0x07,0xF2,0x07,0x92,0x04},
{0x92,0x04,0x92,0x04,0xF2,0x07,0xF2,0x47,0x02,0xC0,0xFE,0xFF,0xFE,0x7F,0x00,0x00},//"间",18\19/
{0x00,0x00,0x00,0x40,0x00,0x70,0xE0,0x37,0xE0,0x17,0x20,0x72,0x20,0x62,0x3F,0x0A},
{0x3F,0x1A,0x24,0x72,0x24,0x62,0xF4,0x0F,0xF4,0x1F,0x24,0x70,0x00,0x60,0x00,0x00},//"点",20\21/
{0x80,0x00,0xC0,0x80,0x60,0xC0,0xB8,0x60,0x9F,0x30,0x87,0x1F,0x82,0x0F,0x80,0x00},
{0x83,0x20,0x87,0x60,0x9C,0x7F,0xB8,0x3F,0x70,0x00,0xE0,0x00,0xC0,0x00,0x40,0x00},//"分",22\23/
{0x12,0x04,0x12,0x07,0xD2,0x03,0xFE,0xFF,0xFF,0xFF,0x91,0x83,0xD1,0x83,0xF8,0xC0},
{0x38,0x40,0x10,0x60,0xFF,0x23,0xFF,0x33,0x08,0x18,0x18,0x0C,0x70,0x07,0x60,0x03},//"秒",24\25/
{0x00,0x00,0xFE,0xFF,0xFE,0xFF,0x22,0x0C,0x7A,0x0C,0xDE,0x07,0x86,0x03,0xFE,0x3F},
{0xFE,0x3F,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0xFE,0x3F,0xFE,0x3F,0x00,0x00},//"阳",26\27/
{0x00,0x40,0x00,0x70,0xFE,0x3F,0xFE,0x0F,0x22,0x40,0x22,0x60,0x22,0x38,0x22,0x1E},
{0xFA,0x07,0xFA,0x01,0x22,0x20,0x22,0x60,0xE2,0x7F,0xE2,0x3F,0x02,0x00,0x02,0x00},//"历",28\29/
{0x40,0x00,0x40,0x00,0x40,0x00,0x5F,0x02,0xDF,0x07,0xD1,0x07,0x51,0x02,0x51,0x22},
{0x51,0x62,0x51,0xC2,0x51,0xC2,0x5F,0x7E,0x5F,0x3E,0x40,0x00,0x40,0x00,0x40,0x00},//"号",30\31/
{0x00,0x00,0x00,0x48,0x00,0x4E,0xBE,0x47,0xBE,0x49,0x2A,0x49,0x2A,0x49,0xEA,0x7F},
{0xEA,0x7F,0x2A,0x49,0x2A,0x49,0x2A,0x49,0x3E,0x49,0x3E,0x49,0x00,0x41,0x00,0x40},//"星",32\33/
{0x00,0x42,0x04,0x62,0xFF,0x3B,0xFF,0x1B,0x54,0x02,0x54,0x0A,0xFF,0x3B,0xFF,0x73},
{0x04,0x7A,0xFE,0x1F,0xFE,0x07,0x22,0x22,0x22,0x62,0xFE,0x7F,0xFE,0x3F,0x00,0x00},//"期",34\35/
};
#define NL 11 //空格地址
uchar xdata LED_RAM[]; /**************************************显示缓冲区*/
/***************滚动显示格式数组***********************************/
uchar xdata G[43]= //显示格式
{
NL,NL,NL,NL,NL, //开头5个空格 0-4
12,13,14,15,16,17,18,19, //当前时间5\6\7\8\9\10\11\12
00,00, //时数据13\14
20,21, //点15\16
00,00, //分数据17\18
22,23, //分19\20
00,00, //秒数据21\22
24,25,26,27,28,29, //秒阳历23\24\25\26\27\28
00,00, //号数据29\30
30,31,32,33,34,35, //号星期 31\32\33\34\35\36
00, //星期数据37
NL,NL,NL,NL,NL, // 空5个38\39\40\41\42
};
//………………………………………………………………
void NYRLoad(void)
{
read_time(&time); //读取数据
G[13]=shi/10; //小时十位
G[14]=shi%10; //小时个位
G[17]=fen/10; //分钟十位
G[18]=fen%10; //分钟个位
G[21]=miao/10; //秒十位
G[22]=miao%10; //秒个位
G[29]=hao/10; //号十位
G[30]=hao%10; //号个位
G[37]=xiqi%10; //星期个位
}
//…………………………以下是移屏显示……………………
void Adisplay()
{
uchar ds;
for(i=0;i<8;i++) //共8行,逐行扫描
{
for(ds=0;ds<8;ds++)
{
P4=i;//给74HC138的数据口送数据,逐一选中各行,
OEB=1;//打开使能端
P0=table1[j+b];//给上8行送数据,刚开始j和b都第一样的,当a满足条件时b就变化了
delay(3);//延时消影
P0=0; //消影
OEB=0;//关闭使能端
OEA=1;//打开使能端
P0=table1[j+b+1];//给下8行送数据,刚开始j和b都第一样的,当a满足条件时b就变化了
delay(3);//延时消影,
P0=0; //消影,
OEA=0; //关闭使能端
j+=2; //j=j+2,第一次j取第1位编,下次就得取第3位编码了,因为字库排序是奇数是上8行,偶数是下8行的编码
}
}
}
//…………………………………………………………………………
那个高手帮忙高整修改下哇!
有没有高手帮忙解决呀,或者帮我写几句,
1、将读到的时间从码表中取出,然后保存到内存中;
2、怎么将那个显示的格式和码表关连起来;
3、