void Delay(unsigned int xms)
{
unsigned char i, j;
while(xms--)
{
i = 2;
j = 239;
do
{
while (--j);
} while (--i);
}
}
void led (unsigned char Location,Number)
{
switch(Location)
{
case 1:P3_7=0x00;P3_6=0xFF;P3_5=0xFF;P3_4=0xFF;break;
case 2:P3_7=0xFF;P3_6=0x00;P3_5=0xFF;P3_4=0xFF;break;
case 3:P3_7=0xFF;P3_6=0xFF;P3_5=0x00;P3_4=0xFF;break;
case 4:P3_7=0xFF;P3_6=0xFF;P3_5=0xFF;P3_4=0x00;break;
}
P0=N[Number];
Delay(1);
P0=0xFF;
}