有关于JLX串行12864打点的问题求助
时间:10-02
整理:3721RD
点击:
unsigned char point_var;
unsigned char Xdat,Ydat;
void Draw_dot(unsigned char X,unsigned char Y)
{
unsigned char dat = 0x01;
dat<<=Y%8;
lcd_address(Y/8+1,X+1);
if(Xdat!=X)
{
Xdat = X;
point_var = dat;
}
if(Ydat!=Y/8)
{
Ydat = Y/8;
point_var = dat;
}
else
{
point_var|=dat;
}
transfer_data_lcd(point_var);
}
/*------------------------------------------------
画矩形
------------------------------------------------*/
void Draw_box(unsigned char x0,unsigned char x1,unsigned char y0,unsigned char y1)
{
Draw_line(x0,x1,y0,y0);
Draw_line(x0,x0,y0,y1);
Draw_line(x0,x1,y1,y1);
Draw_line(x1,x1,y0,y1);
}
这是我写的串行的12864打点程序 但是有点BUG 在用来画矩形时不能形成一个密闭的矩形 求教一下大神 哪里有问题
unsigned char Xdat,Ydat;
void Draw_dot(unsigned char X,unsigned char Y)
{
unsigned char dat = 0x01;
dat<<=Y%8;
lcd_address(Y/8+1,X+1);
if(Xdat!=X)
{
Xdat = X;
point_var = dat;
}
if(Ydat!=Y/8)
{
Ydat = Y/8;
point_var = dat;
}
else
{
point_var|=dat;
}
transfer_data_lcd(point_var);
}
/*------------------------------------------------
画矩形
------------------------------------------------*/
void Draw_box(unsigned char x0,unsigned char x1,unsigned char y0,unsigned char y1)
{
Draw_line(x0,x1,y0,y0);
Draw_line(x0,x0,y0,y1);
Draw_line(x0,x1,y1,y1);
Draw_line(x1,x1,y0,y1);
}
这是我写的串行的12864打点程序 但是有点BUG 在用来画矩形时不能形成一个密闭的矩形 求教一下大神 哪里有问题
12864我记得是8位一起写的,是不是你再写一个点的时候,有的点被抹去了?