double value = 0.0;
inPut_4 inPut4 = new inPut_4();
inPut4.Open("COM3");
value = (double)inPut4.getInPut4_Temp();
txtCurrent.Text = value.ToString("f");
inPut4.Close();
inPut4 = null;
value = double.Parse(txtCurrent.Text);
double temp = (value - 4) / 16 * 70 - 10;
txtTemp.Text = temp.ToString("f1") + "℃";
相关分类