public bool GetSensorValue(NxtBrick.Sensor sensor, out NxtBrick.SensorValues values) { SensorValues sv; bool ret = base.GetSensorValue((Sensor)sensor, out sv); values = sv; return(ret); }
public override bool GetSensorValue(NxtBrick.Sensor sensor, out NxtBrick.SensorValues sensorValues) { sensorValues = new NxtBrick.SensorValues(); sensorValues.Raw = ushort.MinValue; if (IsConnected) { switch (SensorDic[sensor]) { case NxtBrick.SensorType.NoSensor: break; case NxtBrick.SensorType.Switch: break; case NxtBrick.SensorType.Temperature: break; case NxtBrick.SensorType.Reflection: break; case NxtBrick.SensorType.Angle: break; case NxtBrick.SensorType.LightActive: break; case NxtBrick.SensorType.LightInactive: break; case NxtBrick.SensorType.SoundDB: break; case NxtBrick.SensorType.SoundDBA: break; case NxtBrick.SensorType.Custom: break; case NxtBrick.SensorType.Lowspeed: break; case NxtBrick.SensorType.Lowspeed9V: break; default: print("Problem: could not retrieve data because of unknown sensor type {0} set for sensor {1}", SensorDic[sensor], sensor); return false; } return true; } print("Problem: could not retrieve data because of broken connection"); return false; }
public abstract bool GetSensorValue(NxtBrick.Sensor sensor, out NxtBrick.SensorValues sensorValues);