|
BayEOSArduino Library
|
Public Member Functions | |
| MCP342x () | |
| MCP342x (byte adc_addr) | |
| void | reset (void) |
| float | getData (byte adc_addr) |
| float | getData (void) |
| void | setConf (uint8_t adc_addr, uint8_t conf) |
| void | setConf (uint8_t conf) |
| void | setConf (byte adc_addr, byte rdy, byte ch, byte mode, byte rate, byte gain) |
| void | storeConf (byte rate, byte gain) |
| void | runADC (byte ch) |
| int | getADCTime (void) |
| MCP342x::MCP342x | ( | ) |
Constructor
| float MCP342x::getData | ( | byte | adc_addr | ) |
get ADC value in V
| void MCP342x::setConf | ( | byte | adc_addr, |
| byte | rdy, | ||
| byte | ch, | ||
| byte | mode, | ||
| byte | rate, | ||
| byte | gain | ||
| ) |
set configuration rdy - ready bit -> in continuous mode has no effect in one-shot mode rdy=0 -> no efect rdy=1 -> initiate a new conversion
ch - channel selection ch = 0-3 mode - mode = 1 -> continuous mode: the ADC performs data conversion continuously mode = 0 -> one-shot mode: the ADC performs a single conversion and enters standby mode rate - sample rate selection: rate = 0 240 SPS - 12-bits conversion rate = 1 60 SPS - 14-bits conversion rate = 2 15 SPS - 16-bits conversion rate = 3 3.75 SPS - 18-bits conversion gain - amplifier gain selection: gain = 0 -> x1 gain gain = 1 -> x2 gain gain = 2 -> x4 gain gain = 3 -> x8 gain * adc_addr: 0-3
| void MCP342x::setConf | ( | uint8_t | adc_addr, |
| uint8_t | conf | ||
| ) |
set configuration as binary