public ExplorerHat_ADS1015(IXI2CDevice i2cDevice, ExplorerHat_ADS1015_Channel channel, XGain gain = XGain.Volt5, XSamplesPerSecond samples = XSamplesPerSecond.SPS1600) : base(i2cDevice, 0x48) { _channel = channel; _xGain = gain; _xSamples = samples; }
public static ushort ForADS1015(this XSamplesPerSecond xSamples) { ushort[] samplePerSecondMap = { 0x0000, 0x0020, 0x0040, 0x0060, 0x0080, 0x00A0, 0x00C0 }; return(samplePerSecondMap[(int)xSamples]); }