我有源程序,你自己看看,自己画图吧
//***********************************************
//12864 lcd液晶显示
//液晶显示程序:可以显示汉字、字符、数字
//作者:练祥华
//***********************************************
//写指令代码(左)
void PRL0(unsigned char COM)
{
CLRBIT(PORTG,CSA);
SETBIT(PORTG,CSB);
SETBIT(PORTG,CSC);
CLRBIT(PORTF,RS);
SETBIT(PORTF,RW);
DDRA=0x00; // portA as input
PORTA=0XFF;
do
{
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
while (PINA&0x80);
CLRBIT(PORTF,RW);
DDRA=0XFF;
PORTA=COM;
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
//写数据(左)
void PRL1(unsigned char DAT)
{
CLRBIT(PORTG,CSA);
SETBIT(PORTG,CSB);
SETBIT(PORTG,CSC);
CLRBIT(PORTF,RS);
SETBIT(PORTF,RW);
DDRA=0x00; // portA as input
PORTA=0XFF;
do
{
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
while (PINA&0x80);
SETBIT(PORTF,RS);
CLRBIT(PORTF,RW);
DDRA=0XFF;
PORTA=DAT;
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
//写指令代码(中)
void PRM0(unsigned char COM)
{
SETBIT(PORTG,CSA);
CLRBIT(PORTG,CSB);
SETBIT(PORTG,CSC);
CLRBIT(PORTF,RS);
SETBIT(PORTF,RW);
DDRA=0x00; // portA as input
PORTA=0XFF;
do
{
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
while (PINA&0x80);
CLRBIT(PORTF,RW);
DDRA=0XFF;
PORTA=COM;
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
//写数据(中)
void PRM1(unsigned char DAT)
{
SETBIT(PORTG,CSA);
CLRBIT(PORTG,CSB);
SETBIT(PORTG,CSC);
CLRBIT(PORTF,RS);
SETBIT(PORTF,RW);
DDRA=0x00; // portA as input
PORTA=0XFF;
do
{
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
while (PINA&0x80);
SETBIT(PORTF,RS);
CLRBIT(PORTF,RW);
DDRA=0XFF;
PORTA=DAT;
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
//写指令代码(右)
void PRR0(unsigned char COM)
{
SETBIT(PORTG,CSA);
SETBIT(PORTG,CSB);
CLRBIT(PORTG,CSC);
CLRBIT(PORTF,RS);
SETBIT(PORTF,RW);
DDRA=0x00; // portA as input
PORTA=0XFF;
do
{
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
while (PINA&0x80);
CLRBIT(PORTF,RW);
DDRA=0XFF;
PORTA=COM;
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
//写数据(右)
void PRR1(unsigned char DAT)
{
SETBIT(PORTG,CSA);
SETBIT(PORTG,CSB);
CLRBIT(PORTG,CSC);
CLRBIT(PORTF,RS);
SETBIT(PORTF,RW);
DDRA=0x00; // portA as input
PORTA=0XFF;
do
{
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
while (PINA&0x80);
SETBIT(PORTF,RS);
CLRBIT(PORTF,RW);
DDRA=0XFF;
PORTA=DAT;
SETBIT(PORTF,E);
del();
CLRBIT(PORTF,E);
}
void LCD_init()
{
PRL0(0X0C);
PRM0(0X0C);
PRR0(0X0C);
del();
PRL0(0X3F);
PRM0(0X3F);
PRR0(0X3F);
}
void LCD_clear()
{
unsigned char i,j,k,l;
// k=0;
for(i=0;i<8;i++)
{
k=i;
k|=0xb8;
PRL0(k);
PRR0(k);
PRM0(k);
del();
PRL0(0x40);
PRR0(0x40);
PRM0(0x40);
for(j=0;j<64;j++)
{
PRL1(0X00);
PRM1(0X00);
PRR1(0X00);
}
}
}
void LCD_NUM(unsigned char pag,unsigned char row,unsigned char m,unsigned flash char *bytek)
{
unsigned char j=0,i=0,k=0;
if (row < 8) //左屏幕显示
{
k=row;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRL0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRL0(k);
for(i=0;i<6;i++)
{
PRL1(bytek[m*6+i]);
}
}
if((row>=8)&(row<16)) //中屏幕显示数据
{
k=row-8;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRM0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRM0(k);
for(i=0;i<6;i++)
{
PRM1(bytek[m*6+i]);
}
}
if(row>=16) //中屏幕显示数据
{
k=row-16;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRR0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRR0(k);
for(i=0;i<6;i++)
{
PRR1(bytek[m*6+i]);
}
}
}
void LCD_FXNUM(unsigned char pag,unsigned char row,unsigned char m,unsigned flash char *bytek)
{
unsigned char j=0,i=0,k=0;
if (row < 8) //左屏幕显示
{
k=row;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRL0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRL0(k);
for(i=0;i<6;i++)
{
PRL1(~(bytek[m*6+i]));
}
}
if((row>=8)&(row<16)) //中屏幕显示数据
{
k=row-8;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRM0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRM0(k);
for(i=0;i<6;i++)
{
PRM1(~(bytek[m*6+i]));
}
}
if(row>=16) //中屏幕显示数据
{
k=row-16;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRR0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRR0(k);
for(i=0;i<6;i++)
{
PRR1(~(bytek[m*6+i]));
}
}
}
//
//西文字符写入程序
void LCD_XW(unsigned char pag, unsigned char row, unsigned flash char *bytek)
{
unsigned char j=0,i=0,k=0;
if (row < 8) //左屏幕显示
{
k=row;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRL0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRL0(k);
for(i=0;i<6;i++)
{
PRL1(bytek);
}
}
if((row>=8)&&(row<16)) //中屏幕显示数据
{
k=row-8;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRM0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRM0(k);
for(i=0;i<6;i++)
{
PRM1(bytek);
}
}
if(row>=16) //右屏幕显示数据
{
k=row-16;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRR0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRR0(k);
for(i=0;i<6;i++)
{
PRR1(bytek);
}
}
}
//
//西文字符反写入程序
void LCD_FXXW(unsigned char pag, unsigned char row, unsigned flash char *bytek)
{
unsigned char j=0,i=0,k=0;
if (row < 8) //左屏幕显示
{
k=row;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRL0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRL0(k);
for(i=0;i<6;i++)
{
PRL1(~(bytek));
}
}
if((row>=8)&&(row<16)) //中屏幕显示数据
{
k=row-8;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRM0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRM0(k);
for(i=0;i<6;i++)
{
PRM1(~(bytek));
}
}
if(row>=16) //右屏幕显示数据
{
k=row-16;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRR0(pag);
k*=8;
k=k&0x3f;
k=k|0x40;
PRR0(k);
for(i=0;i<6;i++)
{
PRR1(~(bytek));
}
}
}
//中文汉字写入程序
void LCD_HZ(unsigned char pag,unsigned char row, unsigned flash char *hzk)
{
unsigned char j=0,i=0,k=0;
pag=pag*2;
if (row <4)
{
for(j=0;j<2;j++)
{
k=row;
pag=pag+j;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRL0(pag);
k*=16;
k=k&0x3f;
k=k|0x40;
PRL0(k);
for(i=0;i<16;i++)
{
PRL1(hzk[16*j+i]);
}
}
}
if((row>=4)&&(row<8))
{
//k = row-4;
for(j=0;j<2;j++)
{
k=row-4;
pag=pag+j;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRM0(pag);
k*=16;
k=k&0x3f;
k=k|0x40;
PRM0(k);
for(i=0;i<16;i++)
{
PRM1(hzk[16*j+i]);
}
}
}
if(row>=8)
{
//k = row-8;
for(j=0;j<2;j++)
{
k=row-8;
pag=pag+j;
pag=pag & 0x07; // 0<=line<=7
pag=pag|0xb8; //1011 1xxx
PRR0(pag);
k*=16;
k=k&0x3f;
k=k|0x40;
PRR0(k);
for(i=0;i<16;i++)
{
PRR1(hzk[16*j+i]);
}
}
}
}
// 汉字字模表
// 汉字库: 宋体16.dot 纵向取模下高位,数据排列:从左到右从上到下,纵向8点下高位
flash char yu[]={//预,
0x40,0x42,0x52,0xE2,0x5A,0xC6,0x40,0xF2,
0x12,0x1A,0xD6,0x12,0x12,0xFB,0x12,0x00,
0x00,0x40,0x80,0x7F,0x00,0x00,0x80,0x9F,
0x40,0x20,0x1F,0x20,0x20,0x5F,0x80,0x00};
flash char she[]={//"设",
0x40,0x40,0x42,0xCC,0x00,0x40,0xA0,0x9F,
0x81,0x81,0x81,0x9F,0xA0,0x20,0x20,0x00,
0x00,0x00,0x00,0x7F,0xA0,0x90,0x40,0x43,
0x2C,0x10,0x28,0x26,0x41,0xC0,0x40,0x00};
flash char yu1[]={//"雨",
0x02,0x02,0xF2,0x12,0x92,0x12,0x12,0xFE,
0x12,0x92,0x12,0x12,0xFA,0x13,0x02,0x00,
0x00,0x00,0xFF,0x00,0x08,0x11,0x00,0x7F,
0x00,0x08,0x51,0x80,0x7F,0x00,0x00,0x00};
flash char qiang[]={//"强",
0x02,0xE2,0x22,0x22,0x7F,0x02,0x80,0xBE,
0x92,0x92,0xF2,0x92,0x92,0xBF,0x82,0x00,
0x20,0x43,0x82,0x42,0x3E,0x00,0x4F,0x44,
0x44,0x44,0x7F,0x44,0x44,0x64,0xCF,0x00};
flash char shi[]={//"实",
0x10,0x0C,0x04,0x44,0x8C,0x94,0x35,0x06,
0xF4,0x04,0x04,0x04,0x04,0x14,0x0C,0x00,
0x02,0x82,0x82,0x42,0x42,0x23,0x12,0x0E,
0x03,0x0A,0x12,0x22,0x42,0xC3,0x02,0x00};
flash char ji[]={//"际",
0x00,0xFE,0x02,0x22,0xDA,0x06,0x40,0x42,
0x42,0x42,0xC2,0x42,0x43,0x62,0x40,0x00,
0x00,0xFF,0x08,0x10,0x08,0x07,0x10,0x08,
0x46,0x80,0x7F,0x00,0x02,0x04,0x18,0x00};
flash char kai[]={//"开",
0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,
0x82,0x82,0xFE,0x82,0x83,0xC2,0x80,0x00,
0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,
0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00};
flash char du[]={//"度",
0x00,0x00,0xFC,0x24,0x24,0x24,0xFC,0xA5,
0xA6,0xA4,0xFC,0x24,0x34,0x26,0x04,0x00,
0x40,0x20,0x9F,0x80,0x42,0x42,0x26,0x2A,
0x12,0x2A,0x26,0x42,0x40,0xC0,0x40,0x00};
flash char ya[]={//"压",
0x00,0x00,0xFE,0x02,0x82,0x82,0x82,0x82,
0xFE,0x82,0x82,0x82,0xC3,0x82,0x00,0x00,
0x40,0x30,0x0F,0x40,0x40,0x40,0x40,0x40,
0x7F,0x40,0x42,0x44,0x4C,0x60,0x40,0x00};
flash char li[]={//"力",
0x00,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,
0x10,0x10,0x10,0x10,0xF8,0x10,0x00,0x00,
0x00,0x80,0x80,0x80,0x60,0x18,0x07,0x00,
0x20,0x40,0x80,0x40,0x3F,0x00,0x00,0x00};
flash char shi1[]={//"时",
0x00,0xFC,0x84,0x84,0x84,0xFE,0x14,0x10,
0x90,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,
0x00,0x23,0x40,0x80,0x7F,0x00,0x00,0x00};
flash char jiang[]={//"降",
0x00,0xFE,0x02,0x22,0xDA,0x06,0x88,0x44,
0x57,0xA4,0x54,0x4C,0x84,0x80,0x80,0x00,
0x00,0xFF,0x08,0x10,0x08,0x07,0x10,0x1E,
0x12,0xFF,0x12,0x12,0x18,0x11,0x00,0x00};
flash char jian[]={//"间",
0x00,0xF8,0x01,0x02,0xF6,0x10,0x12,0x12,
0x12,0x12,0xFA,0x12,0x02,0xFF,0x02,0x00,
0x00,0xFF,0x00,0x00,0x3F,0x11,0x11,0x11,
0x11,0x11,0x3F,0x40,0x80,0x7F,0x00,0x00};
flash char F_NUM[]={
0x00,0x3E,0x51,0x49,0x45,0x3E, // -0-
0x00,0x00,0x42,0x7F,0x40,0x00, // -1-
0x00,0x62,0x51,0x49,0x49,0x46, // -2-
0x00,0x21,0x41,0x49,0x4D,0x33, // -3-
0x00,0x18,0x14,0x12,0x7F,0x10, // -4-
0x00,0x27,0x45,0x45,0x45,0x39, // -5-
0x00,0x3C,0x4A,0x49,0x49,0x31, // -6-
0x00,0x01,0x71,0x09,0x05,0x03, // -7-
0x00,0x36,0x49,0x49,0x49,0x36, // -8-
0x00,0x46,0x49,0x49,0x29,0x1E, // -9-
};
flash char F_0[]={0x00,0x3E,0x51,0x49,0x45,0x3E}; // -0-
flash char F_1[]={0x00,0x00,0x42,0x7F,0x40,0x00}; // -1-
flash char F_2[]={0x00,0x62,0x51,0x49,0x49,0x46}; // -2-
flash char F_3[]={0x00,0x21,0x41,0x49,0x4D,0x33}; // -3-
flash char F_4[]={0x00,0x18,0x14,0x12,0x7F,0x10}; // -4-
flash char F_5[]={0x00,0x27,0x45,0x45,0x45,0x39}; // -5-
flash char F_6[]={0x00,0x3C,0x4A,0x49,0x49,0x31}; // -6-
flash char F_7[]={0x00,0x01,0x71,0x09,0x05,0x03}; // -7-
flash char F_8[]={0x00,0x36,0x49,0x49,0x49,0x36}; // -8-
flash char F_9[]={0x00,0x46,0x49,0x49,0x29,0x1E}; // -9-
flash char F_10[]={0x00,0x08,0x08,0x08,0x08,0x08};// ---
flash char F_12[]={0X00,0x20,0x10,0x08,0x04,0x02}; // -/-
flash char F_11[]={0x00,0x00,0x36,0x36,0x00,0x00}; // -:-
flash char F_13[]={0X00,0x00,0x60,0x60,0x00,0x00}; // -.-
flash char F_A[]={0x00,0x7C,0x12,0x11,0x12,0x7C}; // -A-
flash char F_B[]={0X00,0x7F,0x49,0x49,0x49,0x36}; // -B-
flash char F_C[]={0x00,0x3E,0x41,0x41,0x41,0x22}; // -C-
flash char F_D[]={0x00,0x7F,0x41,0x41,0x41,0x3E}; // -D-
flash char F_E[]={0x00,0x7F,0x49,0x49,0x49,0x41}; // -E-
flash char F_F[]={0x00,0x7F,0x09,0x09,0x09,0x01}; // -F-
flash char F_G[]={0X00,0x3E,0x41,0x51,0x51,0x72}; // -G-
flash char F_H[]={0X00,0x7F,0x08,0x08,0x08,0x7F}; // -H-
flash char F_I[]={0X00,0x00,0x41,0x7F,0x41,0x00}; // -I-
flash char F_J[]={0X00,0x20,0x40,0x41,0x3F,0x01}; // -J-
flash char F_K[]={0X00,0x7F,0x08,0x14,0x22,0x41}; // -K-
flash char F_L[]={0X00,0x7F,0x40,0x40,0x40,0x40}; // -L-
flash char F_M[]={0X00,0x7F,0x02,0x0C,0x02,0x7F}; // -M-
flash char F_N[]={0X00,0x7F,0x04,0x08,0x10,0x7F}; // -N-
flash char F_O[]={0X00,0x3E,0x41,0x41,0x41,0x3E};// -O-
flash char F_P[]={0X00,0x7F,0x09,0x09,0x09,0x06}; // -P-
flash char F_Q[]={0X00,0x3E,0x41,0x51,0x21,0x5E}; // -Q-
flash char F_R[]={0X00,0x7F,0x09,0x19,0x29,0x46}; // -R-
flash char F_S[]={0X00,0x26,0x49,0x49,0x49,0x32}; // -S-
flash char F_T[]={0X00,0x01,0x01,0x7F,0x01,0x01}; // -T-
flash char F_U[]={0X00,0x3F,0x40,0x40,0x40,0x3F}; // -U-
flash char F_V[]={0X00,0x1F,0x20,0x40,0x20,0x1F}; // -V-
flash char F_W[]={0X00,0x7F,0x20,0x18,0x20,0x7F}; // -W-
flash char F_X[]={0X00,0x63,0x14,0x08,0x14,0x63}; // -X-
flash char F_Y[]={0X00,0x03,0x04,0x78,0x04,0x03}; // -Y-
flash char F_Z[]={0X00,0x61,0x51,0x49,0x45,0x43}; // -Z-
flash char F_m[]={0X00,0x78,0x04,0x78,0x04,0x78}; // -m-
flash char F_g[]={0x00,0x98,0xA4,0xA4,0xA4,0x78}; // -g-
/*
显示数据
界面显示为:
PX-QX6
2012-04-17 02:02:56
JILU:0000000001
YL:0000.2mm
FX:000.0 FS:000.0
QW:000.0 SD:000.0
QY:000000
*/
void DISP_MENU()
{
unsigned char i,j,k,l,m;
unsigned int n;
LCD_XW(0,8,F_P);
LCD_XW(0,9,F_X);
LCD_XW(0,10,F_10);
LCD_XW(0,11,F_Q);
LCD_XW(0,12,F_X);
LCD_XW(0,13,F_1);
LCD_XW(0,14,F_1);
i=YEAR/16;
j=YEAR%16;
LCD_XW(1,0,F_2);
LCD_XW(1,1,F_0);
LCD_NUM(1,2,i,F_NUM);//年
LCD_NUM(1,3,j,F_NUM);
LCD_XW(1,4,F_10);
i=MON/16;
j=MON%16;
LCD_NUM(1,5,i,F_NUM);//月
LCD_NUM(1,6,j,F_NUM);
LCD_XW(1,7,F_10);
i=DAY/16;
j=DAY%16;
LCD_NUM(1,8,i,F_NUM);//日
LCD_NUM(1,9,j,F_NUM);
i=HOUR/16;
j=HOUR%16;
LCD_NUM(1,12,i,F_NUM);//时
LCD_NUM(1,13,j,F_NUM);
LCD_XW(1,14,F_11);
i=MIN/16;
j=MIN%16;
LCD_NUM(1,15,i,F_NUM);//分
LCD_NUM(1,16,j,F_NUM);
LCD_XW(1,17,F_11);
i=SEC/16;
j=SEC%16;
LCD_NUM(1,18,i,F_NUM);//秒
LCD_NUM(1,19,j,F_NUM);
LCD_XW(2,0,F_J);
LCD_XW(2,1,F_L);
LCD_XW(2,2,F_11);
//记录号
i=JILU/1000000000;
LCD_NUM(2,3,i,F_NUM);
i=(JILU%1000000000)/100000000;
LCD_NUM(2,4,i,F_NUM);
i=(JILU%100000000)/10000000;
LCD_NUM(2,5,i,F_NUM);
i=(JILU%10000000)/1000000;
LCD_NUM(2,6,i,F_NUM);
i=(JILU%1000000)/100000;
LCD_NUM(2,7,i,F_NUM);
i=(JILU%100000)/10000;
LCD_NUM(2,8,i,F_NUM);
i=(JILU%10000)/1000;
LCD_NUM(2,9,i,F_NUM);
i=(JILU%1000)/100;
LCD_NUM(2,10,i,F_NUM);
i=(JILU%100)/10;
LCD_NUM(2,11,i,F_NUM);
i=JILU%10;
LCD_NUM(2,12,i,F_NUM);
LCD_XW(3,0,F_Y);//降雨雨量
LCD_XW(3,1,F_L);
LCD_XW(3,2,F_11);
i=(YULIANG%10000)/1000;
j=(YULIANG%1000)/100;
k=(YULIANG%100)/10;
l=YULIANG%10;
LCD_NUM(3,3,i,F_NUM);
LCD_NUM(3,4,j,F_NUM);
LCD_NUM(3,5,k,F_NUM);
LCD_XW(3,6,F_13);
LCD_NUM(3,7,l,F_NUM);
LCD_XW(4,0,F_F);//风向
LCD_XW(4,1,F_X);
LCD_XW(4,2,F_11);
i=(FX%10000)/1000;
j=(FX%1000)/100;
k=(FX%100)/10;
l=FX%10;
LCD_NUM(4,3,i,F_NUM);
LCD_NUM(4,4,j,F_NUM);
LCD_NUM(4,5,k,F_NUM);
LCD_XW(4,6,F_13);
LCD_NUM(4,7,l,F_NUM);
LCD_XW(5,0,F_F);//风速
LCD_XW(5,1,F_S);
LCD_XW(5,2,F_11);
i=(FS%10000)/1000;
j=(FS%1000)/100;
k=(FS%100)/10;
l=FS%10;
LCD_NUM(5,3,i,F_NUM);
LCD_NUM(5,4,j,F_NUM);
LCD_NUM(5,5,k,F_NUM);
LCD_XW(5,6,F_13);
LCD_NUM(5,7,l,F_NUM);
LCD_XW(6,0,F_Q);//气温
LCD_XW(6,1,F_W);
LCD_XW(6,2,F_11);
m=QW/10000;
i=(QW%10000)/1000;
j=(QW%1000)/100;
k=(QW%100)/10;
l=QW%10;
if(m==0)
{
LCD_NUM(6,3,i,F_NUM);
}
else
{
LCD_XW(6,3,F_10);
}
LCD_NUM(6,4,j,F_NUM);
LCD_NUM(6,5,k,F_NUM);
LCD_XW(6,6,F_13);
LCD_NUM(6,7,l,F_NUM);
LCD_XW(7,0,F_S);//湿度
LCD_XW(7,1,F_D);
LCD_XW(7,2,F_11);
i=(SD%10000)/1000;
j=(SD%1000)/100;
k=(SD%100)/10;
l=SD%10;
LCD_NUM(7,3,i,F_NUM);
LCD_NUM(7,4,j,F_NUM);
LCD_NUM(7,5,k,F_NUM);
LCD_XW(7,6,F_13);
LCD_NUM(7,7,l,F_NUM);
LCD_XW(2,14,F_Q);//QIYA
LCD_XW(2,15,F_Y);
LCD_XW(2,16,F_11);
i=(QY%10000)/1000;
j=(QY%1000)/100;
k=(QY%100)/10;
l=QY%10;
LCD_NUM(2,17,i,F_NUM);
LCD_NUM(2,18,j,F_NUM);
LCD_NUM(2,19,k,F_NUM);
LCD_XW(2,20,F_13);
LCD_NUM(2,21,l,F_NUM);
LCD_XW(3,14,F_D);//地温1
LCD_XW(3,15,F_1);
LCD_XW(3,16,F_11);
m=DW1/10000;
i=(DW1%10000)/1000;
j=(DW1%1000)/100;
k=(DW1%100)/10;
l=DW1%10;
if(m==0)
{
LCD_NUM(3,17,i,F_NUM);
}
else
{
LCD_XW(3,17,F_10);
}
LCD_NUM(3,18,j,F_NUM);
LCD_NUM(3,19,k,F_NUM);
LCD_XW(3,20,F_13);
LCD_NUM(3,21,l,F_NUM);
LCD_XW(4,14,F_D);//地温2
LCD_XW(4,15,F_2);
LCD_XW(4,16,F_11);
m=DW2/10000;
i=(DW2%10000)/1000;
j=(DW2%1000)/100;
k=(DW2%100)/10;
l=DW2%10;
if(m==0)
{
LCD_NUM(4,17,i,F_NUM);
}
else
{
LCD_XW(4,17,F_10);
}
LCD_NUM(4,18,j,F_NUM);
LCD_NUM(4,19,k,F_NUM);
LCD_XW(4,20,F_13);
LCD_NUM(4,21,l,F_NUM);
LCD_XW(5,14,F_D);//地温3
LCD_XW(5,15,F_3);
LCD_XW(5,16,F_11);
m=DW3/10000;
i=(DW3%10000)/1000;
j=(DW3%1000)/100;
k=(DW3%100)/10;
l=DW3%10;
if(m==0)
{
LCD_NUM(5,17,i,F_NUM);
}
else
{
LCD_XW(5,17,F_10);
}
LCD_NUM(5,18,j,F_NUM);
LCD_NUM(5,19,k,F_NUM);
LCD_XW(5,20,F_13);
LCD_NUM(5,21,l,F_NUM);
LCD_XW(6,14,F_D);//地温4
LCD_XW(6,15,F_4);
LCD_XW(6,16,F_11);
m=DW4/10000;
i=(DW4%10000)/1000;
j=(DW4%1000)/100;
k=(DW4%100)/10;
l=DW4%10;
if(m==0)
{
LCD_NUM(6,17,i,F_NUM);
}
else
{
LCD_XW(6,17,F_10);
}
LCD_NUM(6,18,j,F_NUM);
LCD_NUM(6,19,k,F_NUM);
LCD_XW(6,20,F_13);
LCD_NUM(6,21,l,F_NUM);
LCD_XW(7,14,F_D);//地温5
LCD_XW(7,15,F_5);
LCD_XW(7,16,F_11);
m=DW5/10000;
i=(DW5%10000)/1000;
j=(DW5%1000)/100;
k=(DW5%100)/10;
l=DW5%10;
if(m==0)
{
LCD_NUM(7,17,i,F_NUM);
}
else
{
LCD_XW(7,17,F_10);
}
LCD_NUM(7,18,j,F_NUM);
LCD_NUM(7,19,k,F_NUM);
LCD_XW(7,20,F_13);
LCD_NUM(7,21,l,F_NUM);
} |