限量_个性。 发表于 2014-5-17 09:48
你检查下 自己的取模方式是否正确
没有12864液晶 没法实际操作 取模应该没问题 应为只写一半的话另一部分也会出来
#include<reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
uint i;
uint code table[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,
0xF8,0xF8,0xF9,0xF9,0xF9,0xF9,0xF9,0xF9,0xF9,0xF9,0xF9,0xF1,0xF1,0xE1,0xE1,0xC1,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0xC1,0xE1,
0xE1,0xF1,0xF1,0xF9,0xF9,0xF9,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xF9,0xF8,0xF8,0xF0,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,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0x00,0x00,0x00,0x00,
0x01,0x01,0x03,0x03,0x03,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x03,0x03,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
sbit cs1=P2^1;
sbit cs2=P2^0;
sbit e=P2^2;
sbit rw=P2^3;
sbit rs=P2^4;
void delay(uchar x)
{
uchar y,z;
for(y=100;y>0;y--)
for(z=x;z>0;z--);
}
void write_zhiling(uchar cs,uchar date)
{
e=0;
rs=0;
rw=0;
P0=date;
cs1=cs/2;
cs2=cs%2;
e=1;
_nop_();
e=0;
}
void write_shuju(uchar cs,uchar date)
{
e=0;
rs=1;
rw=0;
P0=date;
cs1=cs/2;
cs2=cs%2;
e=1;
_nop_();
e=0;
}
void main()
{
write_zhiling(1,0x3f);
write_zhiling(1,0xe0);
write_zhiling(1,0xb8);
write_zhiling(1,0x40);
for(i=0;i<512;i++)
write_shuju(1,table);
while(1);
}
这是程序 大神们帮忙看一下 |