Fork of original senior design repo

Dependencies:   SDFileSystem mbed-rtos mbed wave_player emic2

Fork of BAT_senior_design by BAT

button.h

Committer:
aismail1997
Date:
2017-10-27
Revision:
18:ceac47be2e64
Parent:
13:581a3b02f4c3
Child:
20:c5df903f068a

File content as of revision 18:ceac47be2e64:

#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 mode; // is the system in reading or typing mode
    // AnalogIn linpot;

public:
    // constructors
    button(); // Default
    button(PwmOut servo, DigitalIn pb);

    // 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);     // determine what state the button is in - up or down
    void moveServoIn();   // move servo into the slot
    void moveServoOut();  // move servo out of the slot
    int updateState();
    int getState();
    int getPress();
};

#endif