lib para o framework sgam
Dependencies: MPU6050 Grove_temperature
Dependents: example_smart-grid
peripheral/impl/Temperature.cpp@4:f21aab30658a, 2019-06-03 (annotated)
- Committer:
- AndersonIctus
- Date:
- Mon Jun 03 23:33:00 2019 -0300
- Revision:
- 4:f21aab30658a
- Parent:
- 3:f998244e9f80
- Child:
- 5:caecc2426bbb
- inclusao das logicas para observar uma mudan?a de valor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AndersonIctus | 3:f998244e9f80 | 1 | #include "mbed.h" |
AndersonIctus | 1:53edfdd6ac03 | 2 | #include "Temperature.h" |
AndersonIctus | 1:53edfdd6ac03 | 3 | |
AndersonIctus | 4:f21aab30658a | 4 | Temperature::Temperature(PinName pin): temperature(pin) { |
AndersonIctus | 4:f21aab30658a | 5 | // Temperature::value |
AndersonIctus | 4:f21aab30658a | 6 | } |
AndersonIctus | 1:53edfdd6ac03 | 7 | |
AndersonIctus | 3:f998244e9f80 | 8 | Temperature::~Temperature() { |
AndersonIctus | 3:f998244e9f80 | 9 | // ~Sensor(); |
AndersonIctus | 1:53edfdd6ac03 | 10 | |
AndersonIctus | 3:f998244e9f80 | 11 | temperature.~Grove_temperature(); |
AndersonIctus | 1:53edfdd6ac03 | 12 | } |
AndersonIctus | 1:53edfdd6ac03 | 13 | |
AndersonIctus | 4:f21aab30658a | 14 | float Temperature::getValue() { |
AndersonIctus | 4:f21aab30658a | 15 | return temperature.getTemperature(); |
AndersonIctus | 4:f21aab30658a | 16 | } |
AndersonIctus | 4:f21aab30658a | 17 | |
AndersonIctus | 4:f21aab30658a | 18 | void Temperature::setCallbackReadOcurred( void* (*callback)(float* value), float timeout ) { |
AndersonIctus | 4:f21aab30658a | 19 | Temperature::callback = callback; |
AndersonIctus | 4:f21aab30658a | 20 | // configure the run method !! |
AndersonIctus | 3:f998244e9f80 | 21 | } |
AndersonIctus | 3:f998244e9f80 | 22 | |
AndersonIctus | 4:f21aab30658a | 23 | void Temperature::run(float timeout) { |
AndersonIctus | 4:f21aab30658a | 24 | // TODO: Configure the readTimeOut !! |
AndersonIctus | 4:f21aab30658a | 25 | } |
AndersonIctus | 1:53edfdd6ac03 | 26 | |
AndersonIctus | 4:f21aab30658a | 27 | void Temperature::acceptDataEvent(float* data) { |
AndersonIctus | 4:f21aab30658a | 28 | if(Temperature::callback != NULL) |
AndersonIctus | 4:f21aab30658a | 29 | Temperature::callback(data); |
AndersonIctus | 1:53edfdd6ac03 | 30 | } |