public void SetInputMode(NXTInputPort inputPort, NXTSensorType sensorType, NXTSensorMode sensorMode, bool sendResponse = true) { byte[] command = new byte[5]; byte[] reply = new byte[3]; command[0] = sendResponse ? (byte)NXTCommandType.DIRECT_RESPONSE : (byte)NXTCommandType.DIRECT_NORESPONSE; command[1] = (byte)NXTCommandCode.SETINPUTMODE; command[2] = (byte)inputPort; command[3] = (byte)sensorType; command[4] = (byte)sensorMode; SendCommand(command, reply); }
public void InputState(NXTInputPort inputPort, bool isValid, bool isCalibrated, NXTSensorType sensorType, NXTSensorMode sensorMode, long rawValue, long normalizedValue, long scaleValue, long calibratedValue) { Log("--------- Input State ----------------"); Log("Input Port\t= " + inputPort.ToString()); Log("Is Valid\t= " + isValid.ToString()); Log("Is Calibrated\t= " + isCalibrated.ToString()); Log("Sensor Type\t= " + sensorType.ToString()); Log("Sensor Mode\t= " + sensorMode.ToString()); Log("Raw Value\t= " + rawValue.ToString()); Log("Normalized Value\t= " + normalizedValue.ToString()); Log("Scaled Value\t= " + scaleValue.ToString()); Log("Calibrated Value\t= " + calibratedValue.ToString()); Log("---------------------------------------"); }