ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Input/SampledIn/SampledIn.h

Committer:
el17ajf
Date:
2019-04-04
Revision:
25:bf47fe41883a
Child:
36:c854f1f51f43

File content as of revision 25:bf47fe41883a:

#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;
};