timer 在 case 里面启动不了?
private void timer1_Tick(object sender, EventArgs e){
timer1.Enabled = false;
byte[] buffer11 = new byte[9];
buffer11[0] = 0x5A;
buffer11[1] = 0xA5;
buffer11[2] = 0x05;
buffer11[3] = 0x82;
buffer11[4] = 0x00;
buffer11[5] = 0x65;
buffer11[6] = (byte)(value1);// 0x00;//(byte)(sd);//0x00
buffer11[7] = (byte)(ab);//(byte)(sd1);//0x0B
timer1.Enabled = true;
}
private void serialPort4_DataReceived(object sender, e)
{timer1.Enabled = false;
switch(a)
{
case 1:
a=1;
timer1.Enabled = true;
break;
case 2;
a=2;
timer1.Enabled = true;
break;
case 3;
a=3;
timer1.Enabled = true;
break;
}
}