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
- Revision:
- 66:a89b7430b424
- Parent:
- 56:065bd3a75d97
--- a/sensor.h Thu Jan 19 13:20:50 2017 +0100
+++ b/sensor.h Mon Jan 23 13:22:21 2017 +0100
@@ -1,5 +1,7 @@
#include "common.h"
+#include <vector>
+
class Sensor {
public:
explicit Sensor(SENSOR_TYPE id);
@@ -37,6 +39,19 @@
virtual void resetState();
static const float SEND_INTERVAL;
- private:
+ protected:
AnalogIn sensor_;
};
+
+
+class SoundSensor: public AnalogSensor {
+ public:
+ explicit SoundSensor(SENSOR_TYPE id, PinName pin=PA_4);
+
+ virtual void updateState();
+ virtual Data dataToSend();
+ virtual void resetState();
+
+ private:
+ std::vector<float> values_;
+};
\ No newline at end of file