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: MPU6050 Grove_temperature
Dependents: example_smart-grid
Diff: peripheral/impl/Temperature.cpp
- Revision:
- 1:53edfdd6ac03
- Child:
- 3:f998244e9f80
diff -r c11cefd97479 -r 53edfdd6ac03 peripheral/impl/Temperature.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/peripheral/impl/Temperature.cpp Sat Jun 01 13:17:03 2019 -0300
@@ -0,0 +1,17 @@
+#include "Temperature.h"
+
+Temperature::Temperature(PinName pin): temperature(pin) { }
+
+void* Temperature::getValue() {
+ float value = temperature.getTemperature();
+ Temperature::value = (void*) &value;
+
+ return Temperature::value;
+}
+
+void Temperature::readOcurred(void* (*callBack)(void* value), float timeout = 0.0) {
+ float value = temperature.getTemperature();
+
+ if(callBack != NULL)
+ callBack(Temperature::value);
+}