void display_num(uchar adder,uchar num)//在第三行的左半屏写0-9数字
{
uchar i;
write_lcom(0xbc);
write_lcom(0x40+(adder-1)*8);
for(i=num*16;i<8+num*16;i++)
{
write_ldate(~tablenum[i]);
}
write_lcom(0xbd);
write_lcom(0x40+(adder-1)*8);
for(i=num*16;i<8+num*16;i++)
{
write_ldate(~tablenum[i+8]);
}
}
void display_date(uchar ye,uchar lie, uchar code table[])//在液晶的第ye页第lie列显示table[]所代表的字符
{
uchar i ;
if(lie<5)//在左半屏显示
{
write_lcom(0xb8+(ye-1)*2);
write_lcom(0x40+(lie-1)*16);
for(i=0;i<16;i++)
{
write_ldate(~table[i]);
}
write_lcom(0xb9+(ye-1)*2);
write_lcom(0x40+(lie-1)*16);
for(i=0;i<16;i++)
{
write_ldate(~table[i+16]);
}
}
if(lie>4)//在右半屏显示
{
write_rcom(0xb8+(ye-1)*2);
write_rcom(0x40+(lie-5)*16);
for(i=0;i<16;i++)
{
write_rdate(~table[i]);
}
write_rcom(0xb9+(ye-1)*2);
write_rcom(0x40+(lie-5)*16);
for(i=0;i<16;i++)
{
write_rdate(~table[i+16]);
}
}
}
//在液晶的第ye行第lie列显示字符table前后留有半空格方便字符的居中
void display_ban(uchar ye,uchar lie, uchar code table[])
{
uchar i ;
if(lie<4)//左半屏显示
{
write_lcom(0xb8+(ye-1)*2);
write_lcom(0x40+(lie)*16-8);
for(i=0;i<16;i++)
{
write_ldate(~table[i]);
}
write_lcom(0xb9+(ye-1)*2);
write_lcom(0x40+lie*16-8);
for(i=0;i<16;i++)
{
write_ldate(~table[i+16]);
}
}
if(lie>4)//右半屏显示
{
write_rcom(0xb8+(ye-1)*2);
write_rcom(0x40+(lie-4)*16-8);
for(i=0;i<16;i++)
{
write_rdate(~table[i]);
}
write_rcom(0xb9+(ye-1)*2);
write_rcom(0x40+(lie-4)*16-8);
for(i=0;i<16;i++)
{
write_rdate(~table[i+16]);
}
}
if(lie==4)
{
write_lcom(0xb8+(ye-1)*2);
write_lcom(0x40+(lie)*16-8);
for(i=0;i<8;i++)
{
write_ldate(~table[i]);
}
write_lcom(0xb9+(ye-1)*2);
write_lcom(0x40+lie*16-8);
for(i=0;i<8;i++)
{
write_ldate(~table[i+16]);
}
write_rcom(0xb8+(ye-1)*2);
write_rcom(0x40);
for(i=0;i<8;i++)
{
write_rdate(~table[i+8]);
}
write_rcom(0xb9+(ye-1)*2);
write_rcom(0x40);
for(i=0;i<8;i++)
{
write_rdate(~table[i+16+8]);
}
}
}
-
一周热门 更多>