Added a GPIO to power on/off for external I2C sensor(s) (with LEDs)
Dependencies: UniGraphic mbed vt100
18-Jun-2018 外部センサの電源オン・オフ機能は下位互換の為に無効になっていました。 この版で再度有効にしました。
edge_sensor/edge_temp.h@0:846e2321c637, 2018-04-13 (annotated)
- Committer:
- Rhyme
- Date:
- Fri Apr 13 04:19:23 2018 +0000
- Revision:
- 0:846e2321c637
power to color sensor on/off test OK. Currently the function is disabled.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Rhyme | 0:846e2321c637 | 1 | #ifndef _EDGE_TEMP_H_ |
Rhyme | 0:846e2321c637 | 2 | #define _EDGE_TEMP_H_ |
Rhyme | 0:846e2321c637 | 3 | #include "mbed.h" |
Rhyme | 0:846e2321c637 | 4 | #include "edge_sensor.h" |
Rhyme | 0:846e2321c637 | 5 | #include "LM75B.h" |
Rhyme | 0:846e2321c637 | 6 | #include "SMTC502AT.h" |
Rhyme | 0:846e2321c637 | 7 | |
Rhyme | 0:846e2321c637 | 8 | /** |
Rhyme | 0:846e2321c637 | 9 | * edge_temp edge_sensor to measre temperature sensors |
Rhyme | 0:846e2321c637 | 10 | */ |
Rhyme | 0:846e2321c637 | 11 | |
Rhyme | 0:846e2321c637 | 12 | class edge_temp : public edge_sensor { |
Rhyme | 0:846e2321c637 | 13 | public: |
Rhyme | 0:846e2321c637 | 14 | /** |
Rhyme | 0:846e2321c637 | 15 | * constructor |
Rhyme | 0:846e2321c637 | 16 | * @param *temp1 LM75B temperature sensor object (with Color1) |
Rhyme | 0:846e2321c637 | 17 | * @param *temp2 SMTC502AT temperature sensor object (befor) |
Rhyme | 0:846e2321c637 | 18 | * @param *temp3 SMTC502AT temperature sensor object (after) |
Rhyme | 0:846e2321c637 | 19 | * @param *temp4 LM75B temperature sensor object (with Color2) |
Rhyme | 0:846e2321c637 | 20 | */ |
Rhyme | 0:846e2321c637 | 21 | edge_temp(LM75B *temp1, SMTC502AT *temp2, SMTC502AT *temp3, LM75B *temp4) ; |
Rhyme | 0:846e2321c637 | 22 | |
Rhyme | 0:846e2321c637 | 23 | /** |
Rhyme | 0:846e2321c637 | 24 | * destructor |
Rhyme | 0:846e2321c637 | 25 | */ |
Rhyme | 0:846e2321c637 | 26 | ~edge_temp(void) ; |
Rhyme | 0:846e2321c637 | 27 | |
Rhyme | 0:846e2321c637 | 28 | /** |
Rhyme | 0:846e2321c637 | 29 | * reset and clear the internal values |
Rhyme | 0:846e2321c637 | 30 | */ |
Rhyme | 0:846e2321c637 | 31 | virtual void reset(void) ; |
Rhyme | 0:846e2321c637 | 32 | |
Rhyme | 0:846e2321c637 | 33 | /** |
Rhyme | 0:846e2321c637 | 34 | * prepare for sampling |
Rhyme | 0:846e2321c637 | 35 | */ |
Rhyme | 0:846e2321c637 | 36 | virtual void prepare(void) ; |
Rhyme | 0:846e2321c637 | 37 | |
Rhyme | 0:846e2321c637 | 38 | /** |
Rhyme | 0:846e2321c637 | 39 | * sample measure and store sensor values |
Rhyme | 0:846e2321c637 | 40 | * @return 0: success non-0: failure |
Rhyme | 0:846e2321c637 | 41 | */ |
Rhyme | 0:846e2321c637 | 42 | virtual int sample(void) ; |
Rhyme | 0:846e2321c637 | 43 | |
Rhyme | 0:846e2321c637 | 44 | /** |
Rhyme | 0:846e2321c637 | 45 | * deliver the values to the afero cloud |
Rhyme | 0:846e2321c637 | 46 | */ |
Rhyme | 0:846e2321c637 | 47 | virtual int deliver(void) ; |
Rhyme | 0:846e2321c637 | 48 | |
Rhyme | 0:846e2321c637 | 49 | /** |
Rhyme | 0:846e2321c637 | 50 | * Show the value(s) in the display (TFT) |
Rhyme | 0:846e2321c637 | 51 | */ |
Rhyme | 0:846e2321c637 | 52 | virtual void show(void) ; |
Rhyme | 0:846e2321c637 | 53 | |
Rhyme | 0:846e2321c637 | 54 | private: |
Rhyme | 0:846e2321c637 | 55 | LM75B *_temp1 ; |
Rhyme | 0:846e2321c637 | 56 | SMTC502AT *_temp2 ; |
Rhyme | 0:846e2321c637 | 57 | SMTC502AT *_temp3 ; |
Rhyme | 0:846e2321c637 | 58 | LM75B *_temp4 ; |
Rhyme | 0:846e2321c637 | 59 | float _ftemp[4] ; |
Rhyme | 0:846e2321c637 | 60 | } ; |
Rhyme | 0:846e2321c637 | 61 | |
Rhyme | 0:846e2321c637 | 62 | extern float *current_temp ; |
Rhyme | 0:846e2321c637 | 63 | #endif /* _EDGE_TEMP_H_ */ |