#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit s1=P3^0;
void delay(uint);
void main()
{
if(s1==1)
{
delay(5);
P1=0xf0;
while(!s1);
P1=0;
}
if(s1==2)
{
delay(5);
P1=0x0f;
while(!s1);
P1=0;
}
if(s1==3)
{
delay(5);
P1=0xff;
while(!s1);
P1=0;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
#define uchar unsigned char
#define uint unsigned int
sbit s1=P3^0;
void delay(uint);
void main()
{
if(s1==1)
{
delay(5);
P1=0xf0;
while(!s1);
P1=0;
}
if(s1==2)
{
delay(5);
P1=0x0f;
while(!s1);
P1=0;
}
if(s1==3)
{
delay(5);
P1=0xff;
while(!s1);
P1=0;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}