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