基于Proteus仿真的LM016L液晶显示
#include
sbit e=P2^2;
sbit rw=P2^1;
sbit rs=P2^0;
void sleep(int i){
int x;
while(i--){
for(x=0;x<123;x++);
}
}
void main(){
int x,length;
char c[]={0x38,0x0c,0x06,0x01,0x80};
char xs[]={"lifuhuahaoshuaia"};
length=sizeof(xs)/sizeof(xs[0]);
for(x=0;x<5;x++){
e=0;rw=0;rs=0;
P3=c[x];
e=1;
sleep(1);
e=0;
}
for(x=0;x
共有 0 条评论