-
Notifications
You must be signed in to change notification settings - Fork 0
/
MagneticSensorLSM303.h
50 lines (40 loc) · 1001 Bytes
/
MagneticSensorLSM303.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
#ifndef MAGNETICSENSORLSM303_H
#define MAGNETICSENSORLSM303_H
#include <Arduino.h>
#include "ExternalLibsInc.h"
#include "AbstractSensor.h"
namespace Tinker{
//! Class to handle LSM303 magnetic sensor
/*!
\author Nicola Pezzotti
*/
class MagneticSensorLSM303: public Abstract3dSensor{
public:
typedef String string_type;
public:
MagneticSensorLSM303();
virtual ~MagneticSensorLSM303();
//! Initialize the sensor
void initialize();
//! Returns true if the sensor is initialized
bool isInitialized();
//! Returns sensor name
string_type name()const;
//! Returns sensor version
int32_t version()const;
//! Returns sensor id
int32_t id()const;
//! Returns sensor max value
float maxValue()const;
//! Returns sensor min value
float minValue()const;
//! Returns sensor resolution
float resolution()const;
//! Returns sensor reading.
virtual Vect3d<float> value();
private:
bool _initialized;
mutable Adafruit_LSM303_Mag _sensor;
};
}
#endif