单片机源程序如下:
#include <REGX52.H>
#define uint unsigned int
#define uchar unsigned char
#define duan P0
uchar code table1[][16] = {
0x7F,0x41,0x5D,0x5D,0x5D,0x41,0x7F,0x00,0x71,0x19,0x72,0x24,0xD5,0xBB,0x73,0x3B,
0x5E,0x3E,0xF4,0x38,0x66,0x93,0xC2,0x8E,0xC2,0x2E,0x63,0x0A,0x5E,0x00,0x7F,0x41,
0x5D,0x5D,0x5D,0x41,0x7F,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,
0x8C,0x55,0x13,0x63,0x89,0x37,0x55,0x71,0x2A,0xAD,0x59,0xE2,0x1A,0xF6,0x24,0x31,
0xAF,0xA6,0x20,0x2F,0xA9,0xA3,0x35,0x2A,0xF5,0x94,0xD6,0x37,0x9D,0x8C,0x76,0xED,
0x07,0x34,0x44,0x70,0xD5,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,
0x2F,0x1F,0xD6,0x6F,0x34,0x86,0x55,0xDE,0xB7,0x66,0xE9,0xA8,0x37,0xFF,0xC0,0x43,
0xC7,0x4F,0xDF,0xDF,0x4F,0xC7,0x43,0x40,0x7F,0x14,0xDA,0x1F,0x3A,0xD6,0xEE,0xCD,
0x64,0x8D,0x51,0x65,0x07,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,
0xDF,0x43,0x5F,0x4F,0x4E,0x43,0xD5,0x15,0xE4,0x59,0x24,0xEC,0x4D,0xBC,0x9D,0x67,
0xA1,0xFB,0xEA,0x1B,0xCE,0x06,0x7C,0xAA,0x5B,0x94,0xCA,0x33,0xFC,0x18,0x56,0x1D,
0xF6,0x1C,0x5C,0x19,0x53,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,
0x1F,0x10,0x17,0x17,0x17,0x10,0x1F,0x00,0x0F,0x0F,0x00,0x0B,0x09,0x0D,0x14,0x0D,
0x01,0x1F,0x0B,0x00,0x05,0x1B,0x09,0x0C,0x08,0x0C,0x0A,0x0D,0x0B,0x11,0x09,0x09,
0x0D,0x18,0x1D,0x1B,0x17,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,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,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,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,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,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,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,
};
uchar code table[]={0x3f,0x40,0x80,0xb8,0xc0};
uchar code table2[][32]={
/*-- 文字: 微 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x88,0xC4,0x33,0x80,0x9E,0x90,0x9F,0x90,0x9E,0x20,0xD8,0x17,0xF0,0x10,0x00,
0x01,0x00,0xFF,0x80,0x40,0x3E,0x02,0x02,0x3E,0x10,0x88,0x67,0x18,0x67,0x80,0x00,
/*-- 文字: 信 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x80,0x60,0xF8,0x07,0x00,0x04,0x24,0x24,0x25,0x26,0x24,0x24,0x24,0x04,0x00,
0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0xF9,0x49,0x49,0x49,0x49,0x49,0xF9,0x00,0x00,
/*-- 文字: 扫 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x10,0x10,0x10,0xFF,0x10,0x90,0x04,0x84,0x84,0x84,0x84,0x84,0x84,0xFC,0x00,0x00,
0x04,0x44,0x82,0x7F,0x01,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7F,0x00,0x00,
/*-- 文字: 码 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x04,0x84,0xE4,0x5C,0x44,0xC4,0x00,0x02,0xF2,0x82,0x82,0x82,0xFE,0x80,0x80,0x00,
0x02,0x01,0x7F,0x10,0x10,0x3F,0x00,0x08,0x08,0x08,0x08,0x48,0x88,0x40,0x3F,0x00,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 分 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x80,0x40,0x20,0x90,0x88,0x86,0x80,0x80,0x80,0x83,0x8C,0x10,0x20,0x40,0x80,0x00,
0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x40,0x80,0x40,0x3F,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 也 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x80,0x80,0x40,0xFC,0x40,0x20,0x20,0xFF,0x10,0x10,0x08,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0x40,0x40,0x40,0x4F,0x40,0x42,0x44,0x43,0x40,0x40,0x78,0x00,
/*-- 文字: 是 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x7F,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x7F,0x00,0x00,0x00,0x00,
0x81,0x41,0x21,0x1D,0x21,0x41,0x81,0xFF,0x89,0x89,0x89,0x89,0x89,0x81,0x81,0x00,
/*-- 文字: 爱 --*/
/*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/
0x80,0x64,0x2C,0x34,0x24,0x24,0xEC,0x32,0x22,0x22,0x32,0x2E,0x23,0xA2,0x60,0x00,
0x00,0x41,0x21,0x91,0x89,0x87,0x4D,0x55,0x25,0x25,0x55,0x4D,0x81,0x80,0x80,0x00, } ;
sbit e=P1^0;
sbit rw=P1^1;
sbit rs=P1^2;
sbit cs2=P1^3;
sbit cs1=P1^4;
sbit rst=P1^5;
void delay500us(uint xus)
{
uint i;uchar j;
for(i=xus;i>0;i--)
for(j=55;j>0;j--);
}
void zllift(uchar zl) //左lift
{
cs1=0;cs2=1;
rw=0;
rs=0;
duan=zl;
delay500us(1);
e=1;
delay500us(2);
e=0;
}
void zlright(uchar zl)
{
cs1=1;cs2=0;
rw=0;
rs=0;
duan=zl;
delay500us(1);
e=1;
delay500us(2);
e=0;
}
|