protected string GenerateCommand(CommandTypeEnum commandType, AnalogPortEnum port, int value)
        {
            StringBuilder generateCommand = new StringBuilder();

            generateCommand.Append("C=");
            switch (commandType)
            {
            case CommandTypeEnum.READ:
                generateCommand.Append("R");
                break;

            case CommandTypeEnum.WRITE:
                generateCommand.Append("W");
                break;
            }
            generateCommand.Append(",");
            generateCommand.Append("P=");
            generateCommand.Append(port.ToString());
            generateCommand.Append(",");
            generateCommand.Append("V=");
            generateCommand.Append(value.ToString());
            generateCommand.Append("|");

            return(generateCommand.ToString());
        }
Пример #2
0
 public ArduinoAnalogAnalogPort(PortsMega2560Container.WriteFunction writeFunction, AnalogPortEnum analogPort)
 {
     this._writeFunction = writeFunction;
     this.analogPort     = analogPort;
 }