void Timer0Interrupt(void) interrupt 1
{
TH0 = (65536-100)/256;
TL0 = (65536-100)%256;
Temp = (P3&0xE0)>>5;
switch(Temp)
{
case 7: {IN_A=0;IN_B=0; IN_C=0;SD_A=0; SD_B=0;SD_C=0; };
break; //»ô¶û״̬ȫΪ1
case 5: {SD_C=0;IN_C=0; IN_A=0;SD_A=1; IN_B=1;SD_B=1; };
break; //»ô¶û״̬1
case 4: {SD_B=0;IN_B=0; IN_A=0;SD_A=1; IN_C=1;SD_C=1; };
break; //»ô¶û״̬2
case 6: {SD_A=0;IN_A=0; IN_B=0;SD_B=1; IN_C=1;SD_C=1; };
break; //»ô¶û״̬3
case 2: {SD_C=0;IN_C=0; IN_B=0;SD_B=1; IN_A=1;SD_A=1; };
break; //»ô¶û״̬4
case 3: {SD_B=0;IN_B=0; IN_C=0;SD_C=1; IN_A=1;SD_A=1; };
break; //»ô¶û״̬5
case 1: {SD_A=0;IN_A=0; IN_C=0;SD_C=1; IN_B=1;SD_B=1; };
break; //»ô¶û״̬6
default:break;
}
}
void Timer0Interrupt(void) interrupt 1
{
TH0 = (65536-100)/256;
TL0 = (65536-100)%256;
Temp = (P3&0xE0)>>5;
switch(Temp)
{
case 7: {IN_A=0;IN_B=0; IN_C=0;SD_A=0; SD_B=0;SD_C=0; };
break; //»ô¶û״̬ȫΪ1
case 5: {SD_C=0;IN_C=0; IN_A=0;SD_A=1; IN_B=1;SD_B=1; };
break; //»ô¶û״̬1
case 4: {SD_B=0;IN_B=0; IN_A=0;SD_A=1; IN_C=1;SD_C=1; };
break; //»ô¶û״̬2
case 6: {SD_A=0;IN_A=0; IN_B=0;SD_B=1; IN_C=1;SD_C=1; };
break; //»ô¶û״̬3
case 2: {SD_C=0;IN_C=0; IN_B=0;SD_B=1; IN_A=1;SD_A=1; };
break; //»ô¶û״̬4
case 3: {SD_B=0;IN_B=0; IN_C=0;SD_C=1; IN_A=1;SD_A=1; };
break; //»ô¶û״̬5
case 1: {SD_A=0;IN_A=0; IN_C=0;SD_C=1; IN_B=1;SD_B=1; };
break; //»ô¶û״̬6
default:break;
}
}
举报