Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DHT11 LM75B mpl115a2
SensorModule.hpp
- Committer:
- yukari_hinata
- Date:
- 2015-02-15
- Revision:
- 1:3d6d2ff7ff8a
- Parent:
- 0:98946a466ef8
- Child:
- 3:c1c2c7c5fe82
File content as of revision 1:3d6d2ff7ff8a:
#ifndef SENSORMODULE_H_INCLUDED
#define SENSORMODULE_H_INCLUDED
#include "mbed.h"
#include "DHT11.h"
#include "LM75B.h"
#include "MPL115A2.h"
class SensorModule
{
private:
float new_temperture; // 最後に記録した温度
float new_humidity; // 最後に記録した湿度
float new_pressure; // 最後に記録した気圧
AnalogIn* temperture_sensor;// 温度センサーLM75B
DHT11* humidity_sensor; // 湿度センサーDHT11(精度が論値なので,変えるかも)
I2C* pressure_i2c; // 気圧センサーMPL115A2用のI2C
MPL115A2* pressure_sensor; // 気圧センサーMPL115A2
public:
int n_sample; // 1度のサンプリングでの読み出し回数
public:
SensorModule(int); // 読み出し回数を引数にとる.
~SensorModule(void);
// 各種観測値のゲッター
inline float get_temperture(void) { return new_temperture; }
inline float get_humidity(void) { return new_humidity; }
inline float get_pressure(void) { return new_pressure; }
// 全てのセンサーから値を読み出し, 最新値に更新する
void read_all_sensor(void);
};
#endif /* SENSORMODULE_H_INCLUDED */