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/Acceleration.h
- Revision:
- 101:dbcd3bc51758
- Child:
- 124:311fa85af2b3
diff -r 47ea098f8a47 -r dbcd3bc51758 measurement/Acceleration.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/measurement/Acceleration.h Fri May 08 12:19:57 2015 +0000
@@ -0,0 +1,31 @@
+#ifndef ACCELERATION_H
+#define ACCELERATION_H
+#include "mbed.h"
+#include "MMA7660.h"
+#include "AbstractReporter.h"
+
+
+class Acceleration: public AbstractReporter
+{
+public:
+ Acceleration(): deviceReady(false), sensor(SDA, SCL) {
+ oldValues[0] = 0;
+ oldValues[1] = 0;
+ oldValues[2] = 0;
+ t_start = time(NULL);
+ }
+ virtual ~Acceleration() {}
+ virtual bool init() {
+ deviceReady = sensor.testConnection();
+ return deviceReady;
+ }
+ virtual const char* name() const { return "Acc"; }
+ virtual size_t read(char*, size_t, char*, size_t);
+private:
+ bool deviceReady;
+ MMA7660 sensor;
+ float oldValues[3];
+ time_t t_start;
+};
+
+#endif /* ACCELERATION_H */
\ No newline at end of file

Cumulocity