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: mbed
Fork of el17ajf by
Diff: Input/SampledIn/SampledIn.h
- 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
