示例#1
0
        /* Turn LED on in 2000 ms */
        private void button3_Click(object sender, EventArgs e)
        {
            ArrayList arguments = new ArrayList();
            arguments.Add("2000"); // delay 2000 ms

            ArduinoCommand Command = new ArduinoCommand(Commands.Command3, arguments);

            MessageBox.Show(Command.ToString());
            Arduino.SendCommand(Command);
        }
示例#2
0
 public void SendCommand(ArduinoCommand command)
 {
     if (!_serialPort.IsOpen)
         throw new Exception("Port is not open");
     _serialPort.Write(command.ToString());
 }