#include<reg52.h>
#include<intrins.h>
#deneuintunsignedint
#deneucharunsignedchar
sbitrs=P2^0;
sbitrw=P2^1;
sbiten=P2^2;
sbittrig=P2^5;
sbitecho=P3^2;
bit ag1;
ucharcount;
longintdistance;
unsignedcharcodetable[]={"0123456789"};
voiddelay(uintn)
{
uintx,y;
for(x=n;x>0;x--)
for(y=110;y>0;y--);
}
voiddelayt(uintx)
{
ucharj;
while(x-->0)
{
for(j=0;j<125;j++)
{
;
}
}
}
voidlcd_wcom(ucharcom)
{
rs=0;
rw=0;
P0=com;
delay(5);
en=1;
en=0;
}
评论0
最新资源