Electronic2050
New Member
wow...
thanks a lot dear jason it work very nice
really you are professional.
thanks a lot dear jason it work very nice
really you are professional.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
void plot(unsigned char x,unsigned char y){
unsigned char d;
if(x>63){
b_GLCD_GCS1=1;
b_GLCD_GCS2=0;
x-=64;
}
else
{
b_GLCD_GCS1=0;
b_GLCD_GCS2=1;
}
GLCD_Write_Cmd(0x40+x); //write column address
GLCD_Write_Cmd(0xb8+(y>>3)); //write row address
d=GLCD_Read_Data(); //dummy read
d=GLCD_Read_Data();
d=~d; /////ADD
GLCD_Write_Cmd(0x40+x); //write column address again
d=d&(0xff-(1<<(y&7)));
GLCD_Write_Data(d);
}
d=d&(0xff-(1<<(y&7)));
if(color)d=d|(1<<(y&7));
else d=d&(0xff-(1<<(y&7)));
void bhsmcircle(int xc,int yc,int r)
{
int x=0,y=r,dp;
dp=1-r;
for(;x<y;x++)
{
if(dp<0)
{
dp+=2*x+3;
}
else
{
dp+=2*(x-y)+5;
y--;
}
plot(x+xc,y+yc,1);
plot(-x+xc,-y+yc,1);
plot(x+xc,-y+yc,1);
plot(-x+xc,y+yc,1);
plot(y+xc,x+yc,1);
plot(-y+xc,-x+yc,1);
plot(-y+xc,x+yc,1);
plot(y+xc,-x+yc,1);
}
}
void ClearScreenZone(unsigned char x1,unsigned char y1,unsigned char x2,unsigned char y2){
unsigned char m,n;
for(m=y1;m<y2;m++)
{
for(n=x1;n<x2;n++)
{
if(n>63){
b_GLCD_GCS1=1;
b_GLCD_GCS2=0;
n-=64;
}
else
{
b_GLCD_GCS1=0;
b_GLCD_GCS2=1;
}
GLCD_Write_Cmd(0x40+n); //write column address
GLCD_Write_Cmd(0xb8+(m>>3)); //write row address
GLCD_Write_Data(0x00);
}
}
}