MCP9600 driver.
More...
#include <Adafruit_MCP9600.h>
|
uint8_t | _device_id = 0 |
| The DEVICE ID high byte for MCP9600 or MCP9601.
|
|
◆ begin()
Sets up the I2C connection and tests that the sensor was found.
- Parameters
-
i2c_addr | The I2C address of the target device, default is 0x67 |
theWire | Pointer to an I2C device we'll use to communicate default is Wire |
- Returns
- true if sensor was found, otherwise false.
◆ readThermocouple()
float Adafruit_MCP9600::readThermocouple |
( |
void |
| ) |
|
Read temperature at the end of the thermocouple.
- Returns
- Floating point temperature in Centigrade
◆ readAmbient()
float Adafruit_MCP9600::readAmbient |
( |
void |
| ) |
|
Read temperature at the MCP9600 chip body.
- Returns
- Floating point temperature in Centigrade
◆ enable()
void Adafruit_MCP9600::enable |
( |
bool |
flag | ) |
|
Whether to have the sensor enabled and working or in sleep mode.
- Parameters
-
flag | True to be in awake mode, False for sleep mode |
◆ enabled()
bool Adafruit_MCP9600::enabled |
( |
void |
| ) |
|
Whether the sensor is enabled and working or in sleep mode.
- Returns
- True if in awake mode, False if in sleep mode
◆ getThermocoupleType()
The desired thermocouple type getter.
- Returns
- The selected type: MCP9600_TYPE_K, MCP9600_TYPE_J, MCP9600_TYPE_T, MCP9600_TYPE_N, MCP9600_TYPE_S, MCP9600_TYPE_E, MCP9600_TYPE_B or MCP9600_TYPE_R
◆ setThermocoupleType()
The desired thermocouple type setter.
- Parameters
-
thermotype | The desired type: MCP9600_TYPE_K, MCP9600_TYPE_J, MCP9600_TYPE_T, MCP9600_TYPE_N, MCP9600_TYPE_S, MCP9600_TYPE_E, MCP9600_TYPE_B or MCP9600_TYPE_R |
◆ getFilterCoefficient()
uint8_t Adafruit_MCP9600::getFilterCoefficient |
( |
void |
| ) |
|
The desired filter coefficient getter.
- Returns
- How many readings we will be averaging, can be from 0-7
◆ setFilterCoefficient()
void Adafruit_MCP9600::setFilterCoefficient |
( |
uint8_t |
filtercount | ) |
|
The desired filter coefficient setter.
- Parameters
-
filtercount | How many readings we will be averaging, can be from 0-7 |
◆ setADCresolution()
The desired ADC resolution setter.
- Parameters
-
resolution | Can be MCP9600_ADCRESOLUTION_18, MCP9600_ADCRESOLUTION_16, MCP9600_ADCRESOLUTION_14, or MCP9600_ADCRESOLUTION_12. |
◆ getADCresolution()
The desired ADC resolution getter.
- Returns
- The reslution: MCP9600_ADCRESOLUTION_18, MCP9600_ADCRESOLUTION_16, MCP9600_ADCRESOLUTION_14, or MCP9600_ADCRESOLUTION_12.
◆ readADC()
int32_t Adafruit_MCP9600::readADC |
( |
void |
| ) |
|
Read the raw ADC voltage, say for self calculating a temperature.
- Returns
- The 32-bit signed value from the ADC DATA register
◆ setAmbientResolution()
Sets the resolution for ambient (cold junction) temperature readings.
- Parameters
-
res_value | Ambient_Resolution enum value to set resolution |
◆ setAlertTemperature()
void Adafruit_MCP9600::setAlertTemperature |
( |
uint8_t |
alert, |
|
|
float |
temp |
|
) |
| |
Setter for alert temperature setting.
- Parameters
-
alert | Which alert output we're getting, can be 1 to 4 |
temp | Floating point temperature in Centigrade |
◆ getAlertTemperature()
float Adafruit_MCP9600::getAlertTemperature |
( |
uint8_t |
alert | ) |
|
Getter for alert temperature setting.
- Parameters
-
alert | Which alert output we're getting, can be 1 to 4 |
- Returns
- Floating point temperature in Centigrade
◆ configureAlert()
void Adafruit_MCP9600::configureAlert |
( |
uint8_t |
alert, |
|
|
bool |
enabled, |
|
|
bool |
rising, |
|
|
bool |
alertColdJunction = false , |
|
|
bool |
activeHigh = false , |
|
|
bool |
interruptMode = false |
|
) |
| |
Configure temperature alert.
- Parameters
-
alert | Which alert output we're getting, can be 1 to 4 |
enabled | Whether this alert is on or off |
rising | True if we want an alert when the temperature rises above. False for alert on falling below. |
alertColdJunction | Whether the temperature we're watching is the internal chip temperature (true) or the thermocouple (false). Default is false |
activeHigh | Whether output pin goes high on alert (true) or low (false) |
interruptMode | Whether output pin latches on until we clear it (true) or comparator mode (false) |
◆ getStatus()
uint8_t Adafruit_MCP9600::getStatus |
( |
void |
| ) |
|
Getter for status register.
- Returns
- 8-bit status, see datasheet for bits
The documentation for this class was generated from the following files: