/// <summary> Sets up the data transformer. </summary> /// <param name="Input"> The underlying input whose values should be transformed. </param> /// <param name="RangeTransform"> The mathematical expression to use when transforming range information (Input to Parent). </param> /// <param name="InputTransform"> The mathematical expression to use when transforming input voltage value information (Input to Parent). </param> /// <param name="RangeRawTransform"> Same as RangeTransform, but for the raw values. If left null, the same transform will be used instead. </param> /// <param name="InputRawTransform"> Same as InputTransform, but for the raw values. If left null, the same transform will be used instead. </param> public AnalogueInTransform(IAnalogueIn Input, TransformTypes.DoubleTransform RangeTransform, TransformTypes.DoubleTransform InputTransform, TransformTypes.LongTransform RangeRawTransform = null, TransformTypes.LongTransform InputRawTransform = null) { this.Range = RangeTransform; this.Input = InputTransform; this.RawRange = RangeRawTransform; this.RawInput = InputRawTransform; this.Base = Input; }
/* Typical circuit setup: * * V+ MQ135 RS * ^-----/\/\/\---/\/\/\---o----> Analogue Input * | * RL | * v---------/\/\/\--------/ * GND * * Where the MQ135 resistance changes based on pollutant concentration in the air. */ public MQ135(IAnalogueIn Input, double RS, double RL, double SupplyVoltage = 5) { this.Input = Input; this.RS = RS; this.RL = RL; this.SupplyVoltage = SupplyVoltage; this.Humidity = 0.65F; this.Temperature = 20; }
public Potentiometer(IAnalogueIn Input, int Degrees, bool Invert = false) { this.Input = Input; this.Range = Degrees; this.Invert = Invert; }
/// <summary> Prepares a VH400 soil moisture sensor for use. </summary> /// <param name="Input"> The analogue input where the sensor is connected. </param> /// <param name="VoltageMultiplier"> /// If a resistor divider or other scaling is applied to the sensor's output, specify this parameter in order to scale the readings to the appropriate levels. /// For example, if there is a 3:1 divider, bringing the sensor's 0-3V output to a range of 0-1V on the IAnalogeIn device, then specify a multiplier of 3. /// This would be decided by the hardware configuration of the sensor and analogue input systems, and varies by implementation. /// </param> public VH400(IAnalogueIn Input, double VoltageMultiplier = 1) { this.Input = Input; this.VoltageMultiplier = VoltageMultiplier; }