/* 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); }
public void SendCommand(ArduinoCommand command) { if (!_serialPort.IsOpen) throw new Exception("Port is not open"); _serialPort.Write(command.ToString()); }