Minh Nguyen / Pushbutton

Pushbutton.h

Committer:
khaiminhvn
Date:
2021-02-28
Revision:
1:e47e80a32fb5
Parent:
Pushbutton2.h@ 0:4482075b8b95
Child:
4:3f905ce43f2b

File content as of revision 1:e47e80a32fb5:

#ifndef Pushbutton_H
#define Pushbutton_H
//INCLUDES
#include "mbed.h"
#include "Defs_Sett.h"
#include "PinAssignment.h"

class Pushbutton{
    public:
    //Constructor
    Pushbutton(PinName bt);
    Pushbutton(PinName pin, int* state);
    
    //Methods
    int read();
    
    private:
    //Variables
    DigitalIn button;
    InterruptIn buttonInt;
    static DigitalIn lastPressed;
    int busy;
    int *mode;
    
    void updateMode();
};

#endif