Test fork nhi

Dependencies:   SDFileSystem mbed-rtos mbed emic2

Fork of BAT_senior_design by BAT

button.h

Committer:
aismail1997
Date:
2017-11-29
Revision:
35:ef0921d9b5bd
Parent:
27:b2e53ce54b3e

File content as of revision 35:ef0921d9b5bd:

#include "mbed.h"

#ifndef BUTTON_H
#define BUTTON_H

// This is a button class for our custom button
class button {

// pins connected to the button
private:
    PwmOut servo;
    DigitalIn pb;
    int state; // where is the button (0 - 4)
    int press; // is the button up or down
    int id;    // this is the ID, each button should have a unique id
    // int mode; // is the system in reading or typing mode
    //AnalogIn linpot;

public:
    // constructors
    button(); // Default
    button(PwmOut servo, DigitalIn pb, int id);
    //button(PwmOut servo, DigitalIn pb, AnalogIn linpot);

    // button(PwmOut servo, DigitalIn pb, AnalogIn linpot);
    // functions
    PwmOut getServoPin(); // get the servo pin
    //void setState(int state); // set state
    //void setMode(int mode); // set mode
    void setState(int);     // set what state the button is in - up or down
    void setPress(int);     // set the button press
    void moveServoIn();   // move servo into the slot
    void moveServoOut();  // move servo out of the slot
    int getID();
    int updateState();
    int getState();
    int getPress();
    int getLp();
    void setup();
};

#endif