代码如下,
void Point(uchar x,uchar y)
{ uchar x_k,x_b;
uchar y_k,y_b;
uchar tem1,tem2;
//x &=0x7f;y &=0x3f;
x_k=x/16;x_b=x&0x0f;y_k=y/32;
y_b=y&0x3f;
lcd_wcmd(0x34);//扩展指令集
lcd_wcmd(0x36);//绘图显示关
lcd_wcmd(0x80+y_b);
lcd_wcmd(0x80+x_k+8*y_k);
lcd_readdat();
tem1=lcd_readdat();
tem2=lcd_readdat();
lcd_wcmd(0x80+y_b);
lcd_wcmd(0x80+x_k+8*y_k);
if(x_b<8)
{ lcd_wdat(tem1|(0x01<<(7-x_b)));
lcd_wdat(tem2); }
else
{ lcd_wdat(tem1);
lcd_wdat(tem2|(0x01<<(15-x_b)));
lcd_wcmd(0x36); // 打开绘图
lcd_wcmd(0x30);// 回到基本指令集
}
}
|