Exemple #1
0
 /// <summary>
 /// Constructs Mcp3427 instance
 /// </summary>
 /// <param name="i2CDevice">I2C device used to communicate with the device</param>
 /// <param name="mode">ADC operation mode</param>
 /// <param name="resolution">ADC resolution</param>
 /// <param name="pgaGain">PGA gain</param>
 public Mcp3427(I2cDevice i2CDevice, AdcMode mode = AdcMode.Continuous, AdcResolution resolution = AdcResolution.Bit12, AdcGain pgaGain = AdcGain.X1)
     : this(i2CDevice)
 {
     SetConfig(0, mode: mode, resolution: resolution, pgaGain: pgaGain);
 }
Exemple #2
0
 public static byte SetGainBits(byte configByte, AdcGain gain)
 {
     return((byte)((configByte & ~Helpers.Masks.GainMask) | (byte)gain));
 }