-
Notifications
You must be signed in to change notification settings - Fork 0
/
TMP36.h
41 lines (35 loc) · 797 Bytes
/
TMP36.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
#ifndef TMP36_H
#define TMP36_H
#include "AbstractLog.h"
#include "AbstractSensor.h"
namespace Tinker{
//! A class to handle TMP36 sensor
/*!
\author Nicola Pezzotti
*/
class TMP36: public AbstractScalarSensor{
public:
//! Creates an unitialized TMP36 sensor.
TMP36():_log(0),_voltageRef(0){}
//! Creates an unitialized TMP36 sensor.
TMP36(int pin);
//! Sets sensor pin.
void setPin(int pin);
//! Returns sensor pin.
int pin()const;
//! Sets sensor voltage reference.
void setVoltageRef(float vRef);
//! Returns sensor voltage reference.
float voltageRef()const;
//! Initializes sensor.
void initialize();
//! Return sensor readings.
virtual float value();
private:
int _pin;
float _voltageRef;
public:
AbstractLog* _log;
};
}
#endif