#include<reg52.h>
sfr row=0x90;
sfr col=0xA0;
sfr port=0xB0;
void msdelay(unsigned int);
void main()
{
unsigned int temp=0;
port=0;
row=0x0E;
msdelay(50);
temp=col&0x0F;
if(temp==0x07)
{
port=0x01;
msdelay(50);
}
else if(temp==0x0B)
{
port=0x02;
msdelay(50);
}
else if(temp==0x0D)
{
port=0x03;
msdelay(50);
}
else if(temp==0x0E)
{
port=0x04;
msdelay(50);
}
}
void msdelay(unsigned int item)
{
unsigned int i,j;
for(i=0;i<item;i++)
for(j=0;j<1275;j++);
}
sfr row=0x90;
sfr col=0xA0;
sfr port=0xB0;
void msdelay(unsigned int);
void main()
{
unsigned int temp=0;
port=0;
row=0x0E;
msdelay(50);
temp=col&0x0F;
if(temp==0x07)
{
port=0x01;
msdelay(50);
}
else if(temp==0x0B)
{
port=0x02;
msdelay(50);
}
else if(temp==0x0D)
{
port=0x03;
msdelay(50);
}
else if(temp==0x0E)
{
port=0x04;
msdelay(50);
}
}
void msdelay(unsigned int item)
{
unsigned int i,j;
for(i=0;i<item;i++)
for(j=0;j<1275;j++);
}
No comments:
Post a Comment