CLI(); //关闭中断,开始判断数据
switch(RX_data[1])
{
case 0x01:
pwm1=RX_data[2];
break;
case 0x02:
pwm2=RX_data[2];
break;
case 0x03:
pwm3=RX_data[2];
break;
case 0x04:
pwm4=RX_data[2];
break;
case 0x05:
pwm5=RX_data[2];
break;
case 0x06:
pwm6=RX_data[2];
break;
case 0x07:
pwm7=RX_data[2];
break;
case 0x08:
pwm8=RX_data[2];
break;
case 0x09:
pwm9=RX_data[2];
break;
case 0x0a:
pwm10=RX_data[2];
break;
case 0x0b:
pwm11=RX_data[2];
break;
case 0x0c:
pwm12=RX_data[2];
break;
case 0x0d:
pwm13=RX_data[2];
break;
case 0x0e:
pwm14=RX_data[2];
break;
case 0x0f:
pwm15=RX_data[2];
break;
case 0x10:
pwm16=RX_data[2];
break;
case 0x11:
pwm17=RX_data[2];
break;
case 0x12:
pwm18=RX_data[2];
break;
case 0x13:
pwm19=RX_data[2];
break;
case 0x14:
pwm20=RX_data[2];
break;
default:
SEI(); //错误时打开中断,以便发送错误信息
send_text("ER"); //范围超出20个pwm,就发出大写字母"ER"
break;