同学,拍的比较差不好意思了,是三个像素点竖着一条线,其中第二个没有显示,我的程序如下
我对程序中 x,y,赋值都改过,其中对 y,赋值改动都能改变点的的位置,觉得赋值好改,就把赋值改了,显示时会出现竖着方向多出几个点,或者连续的几个点会把相邻的点屏蔽掉,做到这时我就没再往下做,把其它关于5110的做完之后就其他的去了,多谢你回帖。
void LCD_Set_xy(unsigned char x, unsigned char y )
{
unsigned dat, i,y_standard, command, x_location,y_location;
y_standard=y%8; //y轴分为 0-7 8-15 16-23 24-31 32-39 40-45 5个区域
dat=0x80>>(y%8);
y = 5-y/8;
y_location=0x40|y; // 0x40=1 000 000 5=101 0x45=0x40|0x5=1 000 101
//y 坐标 // 0x40=1 000 000 1=1 0x41=0x40|0x5=1 000 001
command = 0;
LCD_CE_0;
LCD_DC_0;
for(i=0;i<8;i++)
{
if(y_location&0x80) // 10 000 000& 1 000 101 if( (i==1)||(i==5)||(i==7) )
SDIN_1; // 10 000 000& 1 000 001 if( (i==1)||(i==7) )
else
SDIN_0;
SCLK_0;
y_location = y_location << 1;
SCLK_1;
}
LCD_CE_1;
x_location = 0x80|x;
//x 坐标
command = 0;
LCD_CE_0;
LCD_DC_0;
for(i=0;i<8;i++)
{
if(x_location&0x80)
SDIN_1;
else
SDIN_0;
SCLK_0;
x_location = x_location << 1;
SCLK_1;
}
LCD_CE_1;
//赋值
command = 1;
LCD_CE_0;
LCD_DC_1;
for(i=0;i<8;i++)
{
if(i==y_standard) SDIN_1;
else SDIN_0;
SCLK_0;
SCLK_1;
}
LCD_CE_1;
}
|