Exemplo n.º 1
0
        private void AutoMode_Load(object sender, EventArgs e)
        {
            chart1.ChartAreas[0].AxisX.Title = "Time";
            chart1.ChartAreas[0].AxisY.Title = "Temperature";
            this.chart1.ChartAreas[0].AxisX.LabelStyle.Format = "hh:mm:ss";
            Rate.Text   = "1";
            timer.Tick += new EventHandler(timer_Tick);
            double rate = double.Parse(Rate.Text) * 1000;

            timer.Interval = Convert.ToInt32(rate); // in miliseconds
            //myPort.ReadExisting();
            myPort.WriteToPort("GET TEMP\r");
            //Thread.Sleep(100);
            ReadAndWrite();
            timer.Start();
        }
Exemplo n.º 2
0
 private void SetThreshold_Click(object sender, EventArgs e)
 {
     try
     {
         var high = double.Parse(High.Text);
         var low  = double.Parse(Low.Text);
         AutoMode.SetLimits(high, low);
         serial.WriteToPort("SET LIMIT " + low + " " + high + '\r');
     }
     catch (FormatException)
     {
         MessageBox.Show("Enter the temperature in correct format");
     }
 }
 private void LedRedOn_Click(object sender, EventArgs e)
 {
     serialPort.WriteToPort("LED1 ON\r");
     //Thread.Sleep(100);
     Print();
 }