MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / getGain

Method getGain

libraries/ADS1x15/ADS1X15.cpp:212–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210
211
212uint8_t ADS1X15::getGain()
213{
214 if (!(_config & ADS_CONF_GAIN)) return 0;
215 switch (_gain)
216 {
217 case ADS1X15_PGA_6_144V: return 0;
218 case ADS1X15_PGA_4_096V: return 1;
219 case ADS1X15_PGA_2_048V: return 2;
220 case ADS1X15_PGA_1_024V: return 4;
221 case ADS1X15_PGA_0_512V: return 8;
222 case ADS1X15_PGA_0_256V: return 16;
223 }
224 _err = ADS1X15_INVALID_GAIN;
225 return _err;
226}
227
228
229float ADS1X15::toVoltage(int16_t value)

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36