コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: worlderic/FOTOMIND
 private void btnShow_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ArduinoCommands temp = new ArduinoCommands();
         temp = (ArduinoCommands)listCommands.SelectedItem;
         MessageBox.Show(temp.ToStringDetailed());
     }
     catch (Exception)
     {
         MessageBox.Show("No command was selected");
     }
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: worlderic/FOTOMIND
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     if (tbNewCmdTitle.Text != "" && tbNewCmd.Text != "")
     {
         ArduinoCommands newCmd = new ArduinoCommands();
         newCmd.Title   = tbNewCmdTitle.Text;
         newCmd.Command = tbNewCmd.Text;
         ArdCmds.Add(newCmd);
         listCommands.ItemsSource = ArdCmds;
         SerializeCommands(ArdCmds);
         tbNewCmd.Clear();
         tbNewCmdTitle.Clear();
     }
 }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: worlderic/FOTOMIND
        private void btnSend_Click(object sender, RoutedEventArgs e)
        {
            ArduinoCommands tempCmd = new ArduinoCommands();

            tempCmd = (ArduinoCommands)listCommands.SelectedItem;
            bool verify;

            verify = SerialPort1.Send(tempCmd.Command);
            if (verify)
            {
                lblStatus.Content = "Command sent to Arduino";
            }
            else
            {
                lblStatus.Content = "Could not send command";
            }
        }