Minh Nguyen / Pushbutton

Pushbutton.h

Committer:
khaiminhvn
Date:
2021-03-12
Revision:
4:3f905ce43f2b
Parent:
1:e47e80a32fb5
Child:
9:7dd8100b2ba5

File content as of revision 4:3f905ce43f2b:

#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, int* flag);
    
    //Methods
    int read();
    
    private:
    //Variables
    DigitalIn button;
    InterruptIn buttonInt;
    static DigitalIn lastPressed;
    int busy;
    int *mode;
    int *flag;
    
    void updateMode();
};

#endif