Minh Nguyen / Pushbutton

Pushbutton.h

Committer:
khaiminhvn
Date:
2021-03-24
Revision:
9:7dd8100b2ba5
Parent:
4:3f905ce43f2b

File content as of revision 9:7dd8100b2ba5:

#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, PinName bt2);
    
    //Methods
    int read();
    void setConnected(bool con);
    
    private:
    //Variables
    DigitalIn button,button2;
    InterruptIn buttonInt;
    static DigitalIn lastPressed;
    int *mode;
    int *flag;
    bool connected = false;
    
    void updateMode();
};

#endif