ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Revision:
25:bf47fe41883a
Child:
36:c854f1f51f43
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Input/SampledIn/SampledIn.h	Thu Apr 04 15:53:06 2019 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+class SampledIn {
+public:
+    SampledIn(PinName pin);
+    ~SampledIn();
+    bool hit_frame();
+    
+private:
+    static const double freq = 0.005;
+    static const int min_frames = 8;
+    DigitalIn * in;
+    int last_in;
+    int stable_output;
+    void sample();
+    int stable_frames;
+    Ticker ticker;
+    bool last_value_returned;
+};
\ No newline at end of file