Taiyo Mineo / SensorModule

Dependencies:   DHT11 LM75B mpl115a2

Dependents:   WeatherPredictor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SensorModule.hpp Source File

SensorModule.hpp

00001 #ifndef SENSORMODULE_H_INCLUDED
00002 #define SENSORMODULE_H_INCLUDED
00003 
00004 #include "mbed.h"
00005 #include "DHT11.h"
00006 #include "LM75B.h"
00007 #include "MPL115A2.h"
00008 
00009 class SensorModule
00010 {
00011 private:
00012     // こいつらがキューになってると便利そう(小並感)
00013     float  new_temperture;      // 最後に記録した温度
00014     float  new_humidity;        // 最後に記録した湿度
00015     float  new_pressure;        // 最後に記録した気圧
00016     
00017     AnalogIn* temperture_sensor;// 温度センサーLM75B
00018     DHT11*    humidity_sensor;  // 湿度センサーDHT11(精度が論値なので,変えるかも)
00019     I2C*      pressure_i2c;     // 気圧センサーMPL115A2用のI2C
00020     MPL115A2* pressure_sensor;  // 気圧センサーMPL115A2
00021 
00022 public:
00023     int   n_sample;             // 1度のサンプリングでの読み出し回数
00024     
00025     public:
00026     SensorModule(int);           // 読み出し回数を引数にとる.
00027     ~SensorModule(void);
00028     
00029     // 各種観測値のゲッター
00030     inline float get_temperture(void) { return new_temperture; }
00031     inline float get_humidity(void) { return new_humidity; }
00032     inline float get_pressure(void) { return new_pressure; }
00033     
00034     // 全てのセンサーから値を読み出し, 最新値に更新する
00035     void read_all_sensor(void);
00036     
00037 };
00038 
00039 #endif /* SENSORMODULE_H_INCLUDED */