/// <summary> /// LEGO NXT Command: Set Input Mode /// </summary> /// <param name="sensorPort"></param> /// <param name="sensorType"></param> /// <param name="sensorMode"></param> public LegoSetInputMode(NxtSensorPort sensorPort, LegoSensorType sensorType, LegoSensorMode sensorMode) : base(3, LegoCommand.NxtDirectCommand, (byte)LegoCommandCode.SetInputMode, 0x00, 0x00, 0x00) { InputPort = sensorPort; SensorType = sensorType; SensorMode = sensorMode; }
/// <summary> /// Configures a sensor on the specified port. /// </summary> /// <param name="port">The port the sensor is connected to.</param> /// <param name="type">The type of the sensor connected to the port.</param> /// <param name="mode"> /// The mode in which the sensor operates. The sensor mode affects the scaled value, /// which the NXT firmware calculates depending on the sensor type and sensor mode. /// </param> public void SetInputMode( SensorPort port, LegoSensorType type, LegoSensorMode mode ) { var data = CommandHelper.InitializeData(LegoCommandCode.SetInputMode, CommandType.DirectCommandWithoutResponse, 5); data[ 2 ] = (byte) port; data[ 3 ] = (byte) type; data[ 4 ] = (byte) mode; Transmit( data ); // Return package: 0:0x02, 1:Command, 2:StatusByte }