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.
Diff: sensor.h
- Branch:
- multipipe
- Revision:
- 51:090149c4aa28
- Parent:
- 50:e83e38fece23
- Child:
- 56:065bd3a75d97
diff -r e83e38fece23 -r 090149c4aa28 sensor.h
--- a/sensor.h Tue Jan 17 14:41:20 2017 +0100
+++ b/sensor.h Wed Jan 18 16:57:05 2017 +0100
@@ -3,12 +3,12 @@
class Sensor {
public:
explicit Sensor(SENSOR_TYPE id);
-
+
virtual void updateState() = 0;
virtual Data dataToSend() = 0;
virtual void resetState() = 0;
SENSOR_TYPE getId() { return sensor_id_; };
-
+
protected:
SENSOR_TYPE sensor_id_;
};
@@ -16,11 +16,11 @@
class DigitalSensor: public Sensor {
public:
explicit DigitalSensor(SENSOR_TYPE id, PinName pin=PA_10);
-
+
virtual void updateState();
virtual Data dataToSend();
virtual void resetState();
-
+
static const float SEND_INTERVAL;
private:
DigitalIn sensor_;
@@ -31,11 +31,11 @@
class AnalogSensor: public Sensor {
public:
explicit AnalogSensor(SENSOR_TYPE id, PinName pin=PA_4);
-
+
virtual void updateState();
virtual Data dataToSend();
virtual void resetState();
-
+
static const float SEND_INTERVAL;
private:
AnalogIn sensor_;