-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSensorTemperature.h
executable file
·61 lines (41 loc) · 1.04 KB
/
SensorTemperature.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef SENSOR_TEMPERATURE
#define SENSOR_TEMPERATURE
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
// -------- Uncomment the sensor to be used --------
//#define USE_MPL3115A2
//#define USE_SI7021
#define USE_AM2315 // to use
//--------------------------------------------------
#ifdef USE_MPL3115A2
#include "SparkFunMPL3115A2.h"
#endif
#ifdef USE_SI7021
#include "SparkFun_Si7021_Breakout_Library.h"
#endif
#ifdef USE_AM2315
#include "Adafruit_AM2315.h"
#endif
class SensorTemperature
{
public:
//Public Functions
SensorTemperature();
int begin(); // Begin the Temperature sensor selected (return 0 if ok, return 1 if erro)
float getTemperature(); // Return the Temperature sensor measure (ºC)
//Public Variables
private:
#ifdef USE_MPL3115A2
MPL3115A2 mpl31; // Define the sensor object
#endif
#ifdef USE_SI7021
Weather si70; // Define the sensor object
#endif
#ifdef USE_AM2315
Adafruit_AM2315 am23; // Define the sensor object
#endif
//Private Functions
//Private Variables
};
#endif