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: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: measurement/Temperature.h
- Revision:
- 100:dbcd3bc51758
- Child:
- 123:311fa85af2b3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/measurement/Temperature.h Fri May 08 12:19:57 2015 +0000
@@ -0,0 +1,28 @@
+#ifndef TEMPERATURE_H
+#define TEMPERATURE_H
+#include "mbed.h"
+#include "LM75B.h"
+#include "AbstractReporter.h"
+
+
+class Temperature: public AbstractReporter
+{
+public:
+ Temperature(): deviceReady(false), oldValue(0), sensor(D14, D15) {
+ t_start = time(NULL);
+ }
+ virtual ~Temperature() {}
+ virtual bool init() {
+ deviceReady = sensor.open();
+ return deviceReady;
+ }
+ virtual const char* name() const { return "Temp"; }
+ virtual size_t read(char*, size_t, char*, size_t);
+private:
+ bool deviceReady;
+ float oldValue;
+ time_t t_start;
+ LM75B sensor;
+};
+
+#endif /* TEMPERATURE_H */
\ No newline at end of file
