Пример #1
0
        private void btnConnectArduino_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _arduino = new Arduino(txtPortName.Text, txtBaudRate.Text);

                _lastMessageSentTime = DateTime.Now;

                btnTurnAllOff.IsEnabled = true;
                btnTurnBlueOn.IsEnabled = true;
                btnTurnGreenOn.IsEnabled = true;
                btnTurnRedOn.IsEnabled = true;
            }
            catch (Exception ex)
            {
                btnTurnAllOff.IsEnabled = false;
                btnTurnBlueOn.IsEnabled = false;
                btnTurnGreenOn.IsEnabled = false;
                btnTurnRedOn.IsEnabled = false;

                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
 public TfsController(Arduino arduino)
 {
     _arduino = arduino;
 }