public Sound(ADS1015 adc, ADS1015.Channel channel, ADS1015.Gain gain, UnitsNet.ElectricPotential volts) { this.adc = adc; this.channel = channel; this.gain = gain; this.volts = volts; }
/// <summary> /// Gets the altitude. /// </summary> /// <param name="connection">The BMP085 connection.</param> /// <param name="sealevelPressure">The sealevel pressure.</param> /// <returns>The altitude</returns> public static Length GetAltitude(this Bmp085I2cConnection connection, UnitsNet.Pressure sealevelPressure) { var pressure = connection.GetPressure(); return Length.FromMeters(44330 * (1.0 - Math.Pow(pressure.Pascals / sealevelPressure.Pascals, 1 / 5.255))); }