Adafruit ADT7410 Library
Adafruit_ADT7410.h
Go to the documentation of this file.
1 
17 #ifndef _ADAFRUIT_ADT7410_H
18 #define _ADAFRUIT_ADT7410_H
19 
20 #include "Arduino.h"
21 #include <Adafruit_BusIO_Register.h>
22 #include <Adafruit_I2CDevice.h>
23 #include <Adafruit_Sensor.h>
24 
25 #define ADT7410_I2CADDR_DEFAULT 0x48
26 
27 #define ADT7410_REG__ADT7410_TEMPMSB 0x0
28 #define ADT7410_REG__ADT7410_TEMPLSB 0x1
29 #define ADT7410_REG__ADT7410_STATUS 0x2
30 #define ADT7410_REG__ADT7410_CONFIG 0x3
31 #define ADT7410_REG__ADT7410_ID 0xB
32 #define ADT7410_REG__ADT7410_SWRST 0x2F
33 
34 
35 typedef enum { ADT7410_13BIT = 0, ADT7410_16BIT } adt7410Resolution;
36 
41 class Adafruit_ADT7410 : public Adafruit_Sensor {
42 public:
44  bool begin(uint8_t a = ADT7410_I2CADDR_DEFAULT, TwoWire *wire = &Wire);
45  bool reset(void);
46  float readTempC();
47 
48  bool getEvent(sensors_event_t *event);
49  void getSensor(sensor_t *sensor);
52 
53 private:
54  int32_t _sensorID = 7410;
55  Adafruit_I2CDevice *i2c_dev = NULL;
56 };
57 
58 #endif
#define ADT7410_I2CADDR_DEFAULT
I2C address.
Definition: Adafruit_ADT7410.h:25
bool setResolution(adt7410Resolution res)
Sets the current ADC resolution setting.
Definition: Adafruit_ADT7410.cpp:170
bool begin(uint8_t a=ADT7410_I2CADDR_DEFAULT, TwoWire *wire=&Wire)
Setups the HW.
Definition: Adafruit_ADT7410.cpp:43
bool reset(void)
Perform a soft reset.
Definition: Adafruit_ADT7410.cpp:75
adt7410Resolution
Definition: Adafruit_ADT7410.h:35
float readTempC()
Reads the 16-bit temperature register and returns the Centigrade temperature as a float...
Definition: Adafruit_ADT7410.cpp:90
Class that stores state and functions for interacting with ADT7410 Temp Sensor.
Definition: Adafruit_ADT7410.h:41
void getSensor(sensor_t *sensor)
Gets the sensor_t device data, Adafruit Unified Sensor format.
Definition: Adafruit_ADT7410.cpp:109
adt7410Resolution getResolution()
Gets the current ADC resolution setting.
Definition: Adafruit_ADT7410.cpp:153
bool getEvent(sensors_event_t *event)
Gets the most recent sensor event, Adafruit Unified Sensor format.
Definition: Adafruit_ADT7410.cpp:133
Adafruit_ADT7410()
Instantiates a new ADT7410 class.
Definition: Adafruit_ADT7410.cpp:35