void Serial_interrupt() interrupt 4
{
if(RI) //RI是串口接收中斷申請標(biāo)志位,就是有數(shù)據(jù)進來的時候,RI自動置0,接受完數(shù)據(jù)后,需要手動置1,進行下一個數(shù)據(jù)的接收
{
RI=0; //接收中斷信號清零,表示將繼續(xù)接收
switch(SBUF)
{
case 'A':led1=~led1;break;
case 'B':led2=~led2;break;
case 'C':led3=~led3;break;
case '!':led4=~led4;break;
case '@':led5=~led5;break;
case '#':led6=~led6;break;
case '$':dingshi1=0;break;
case '%':dingshi2=0;break;
case '&':dingshi3=0;break;
}
}
}