1616#ifndef WipperSnapper_I2C_Driver_D6T1A_H
1717#define WipperSnapper_I2C_Driver_D6T1A_H
1818
19- #include " WipperSnapper_I2C_Driver.h"
2019#include < OmronD6T.h>
2120
21+ #include " WipperSnapper_I2C_Driver.h"
22+
2223/* *************************************************************************/
2324/* !
2425 @brief Class that provides a sensor driver for the D6T1A temperature
2526 and pressure sensor.
2627*/
2728/* *************************************************************************/
2829class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
29-
30- public:
30+ public:
3131 /* ******************************************************************************/
3232 /* !
3333 @brief Constructor for an D6T1A sensor.
@@ -57,14 +57,12 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
5757 */
5858 /* ******************************************************************************/
5959 bool begin () {
60- _d6t1a = new OmronD6T ( OmronD6T.Model .D6T_1A , _i2c);
60+ _d6t1a = new OmronD6T (OmronD6T.Model .D6T_1A , _i2c);
6161 // attempt to initialize D6T1A
62- if (!_d6t1a->begin (_sensorAddress))
63- return false ;
62+ if (!_d6t1a->begin (_sensorAddress)) return false ;
6463 return true ;
6564 }
6665
67-
6866 /* ******************************************************************************/
6967 /* !
7068 @brief Checks if sensor was read within last 1s, or is the first read.
@@ -94,8 +92,6 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
9492 return true ;
9593 }
9694
97-
98-
9995 /* ******************************************************************************/
10096 /* !
10197 @brief Gets the D6T1A's current temperature.
@@ -111,7 +107,7 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
111107 tempEvent->temperature = _deviceTemp;
112108 return true ;
113109 }
114- return false ; // sensor not read recently, return false
110+ return false ; // sensor not read recently, return false
115111 }
116112
117113 /* ******************************************************************************/
@@ -129,15 +125,14 @@ class WipperSnapper_I2C_Driver_D6T1A : public WipperSnapper_I2C_Driver {
129125 tempEvent->temperature = _objectTemp;
130126 return true ;
131127 }
132- return false ; // sensor not read recently, return false
128+ return false ; // sensor not read recently, return false
133129 }
134130
135-
136- protected:
137- float _deviceTemp = nan; // /< Device temperature in Celsius
138- float _objectTemp = nan; // /< Object temperature in Celsius
139- uint32_t _lastRead = 0 ; // /< Last time the sensor was read in milliseconds
140- OmronD6T *_d6t1a = nullptr ; // /< D6T1A object
131+ protected:
132+ float _deviceTemp = nan; // /< Device temperature in Celsius
133+ float _objectTemp = nan; // /< Object temperature in Celsius
134+ uint32_t _lastRead = 0 ; // /< Last time the sensor was read in milliseconds
135+ OmronD6T *_d6t1a = nullptr ; // /< D6T1A object
141136};
142137
143- #endif // WipperSnapper_I2C_Driver_D6T1A
138+ #endif // WipperSnapper_I2C_Driver_D6T1A
0 commit comments