Exemple #1
0
 /// <summary>Standard Constructor</summary>
 /// <param name='Ch'>Channel Number</param>
 /// <param name='res'>Bits of resolution required</param>
 /// <param name='cm'>Conversion Mode</param>
 /// <param name='Gain'>Gain multiplier of the pre-ADC amplifier</param>
 public Mcp342x(MCP342xChannel ch, MCP324xResolution res, MCP342xConversionMode cm, MCP342xGain g)
 {
     channel        = ch;
     resolution     = res;
     conversionMode = cm;
     gain           = g;
 }
Exemple #2
0
 /// <summary>
 /// Reads a channel from the device.
 /// </summary>
 /// <param name="channel"></param>
 /// <returns>Value in mV from a 2.048V reference.</returns>
 public double ReadChannel(MCP342xChannel channel)
 {
     Channel = channel;
     return ReadValue();
 }
Exemple #3
0
 /// <summary>Selects the input channel to be read</summary>
 /// <param name='Ch'>Channel Number</param>
 public void SetInputChannel(MCP342xChannel Ch)
 {
     channel = Ch;
     configDirty = true;
 }
Exemple #4
0
 /// <summary>Extended Constructor</summary>
 /// <param name='Ch'>Channel Number</param>
 /// <param name='res'>Bits of resolution required</param>
 /// <param name='cm'>Conversion Mode</param>
 /// <param name='Gain'>Gain multiplier of the pre-ADC amplifier</param>
 /// <param name='Offset'>See datasheet, only required for MCP3423/4 or MCP3422 where Address-Option is NOT A0</param>
 public Mcp342x(MCP342xChannel ch, MCP324xResolution res, MCP342xConversionMode cm, MCP342xGain g, ushort addrOffset)
     : this(ch, res, cm, g)
 {
     baseAddressOffset = addrOffset;
 }
Exemple #5
0
 /// <summary>Standard Constructor</summary>
 /// <param name='Ch'>Channel Number</param>
 /// <param name='res'>Bits of resolution required</param>
 /// <param name='cm'>Conversion Mode</param>
 /// <param name='Gain'>Gain multiplier of the pre-ADC amplifier</param>
 public Mcp342x(MCP342xChannel ch, MCP324xResolution res, MCP342xConversionMode cm, MCP342xGain g)
 {
     channel = ch;
     resolution = res;
     conversionMode = cm;
     gain = g;
 }
Exemple #6
0
 /// <summary>Extended Constructor</summary>
 /// <param name='Ch'>Channel Number</param>
 /// <param name='res'>Bits of resolution required</param>
 /// <param name='cm'>Conversion Mode</param>
 /// <param name='Gain'>Gain multiplier of the pre-ADC amplifier</param>
 /// <param name='Offset'>See datasheet, only required for MCP3423/4 or MCP3422 where Address-Option is NOT A0</param>
 public Mcp342x(MCP342xChannel ch, MCP324xResolution res, MCP342xConversionMode cm, MCP342xGain g, ushort addrOffset)
     : this(ch, res, cm, g)
 {
     baseAddressOffset = addrOffset;
 }
Exemple #7
0
 /// <summary>Selects the input channel to be read</summary>
 /// <param name='Ch'>Channel Number</param>
 public void SetInputChannel(MCP342xChannel Ch)
 {
     channel     = Ch;
     configDirty = true;
 }
Exemple #8
0
 /// <summary>
 /// Reads a channel from the device.
 /// </summary>
 /// <param name="channel"></param>
 /// <returns>Value in mV from a 2.048V reference.</returns>
 public double ReadChannel(MCP342xChannel channel)
 {
     Channel = channel;
     return(ReadValue());
 }