Ries Twisk / Mbed 2 deprecated JoyStick

Dependencies:   USBDevice mbed-rtos mbed

Fork of JoyStick by Ries Twisk

AnalogInFiltered.h

Committer:
rvt
Date:
2013-08-30
Revision:
2:ae7a31a3c618
Parent:
1:5b2ab44eb31f
Child:
5:a0bb17c379ce

File content as of revision 2:ae7a31a3c618:

#ifndef ANALOGINFILTERED_H
#define ANALOGINFILTERED_H

#include "mbed.h"
#include "AnalogFilterInterface.h"

/**
Analog input, this reads a analog value from a PIN and send the data through the filterchain
*/
class AnalogInFiltered {
    private:
        AnalogIn *_ain;
        long   _lastValue;
        int _fuzzyFactor;
        AnalogFilterInterface   *_filter;
    public:   
        /**
        filter : Failter chain
        pin : Analog input to read
        */
        AnalogInFiltered(AnalogFilterInterface *filter, PinName pin, int fuzzyFactor);
        ~AnalogInFiltered();
        
        // Read a value from analog in
        void measure ();
        
        
        long getData();
        
        
        // Test if the input value is changed based on a offset
        bool getIsChanged();
        
        int getFuzzyFactor();
};

#endif