BAT / Mbed 2 deprecated BAT_Read

Dependencies:   SDFileSystem emic2 mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers button.h Source File

button.h

00001 #include "mbed.h"
00002 
00003 #ifndef BUTTON_H
00004 #define BUTTON_H
00005 
00006 // This is a button class for our custom button
00007 class button {
00008 
00009 // pins connected to the button
00010 private:
00011     PwmOut servo;
00012     DigitalIn pb;
00013     int state; // where is the button (0 - 4)
00014     int press; // is the button up or down
00015     int id;    // this is the ID, each button should have a unique id
00016 
00017 public:
00018     // constructors
00019     button(); // Default
00020     button(PwmOut servo, DigitalIn pb, int id);
00021 
00022     // functions
00023     PwmOut getServoPin(); // get the servo pin
00024     void setState(int);     // set what state the button is in - up or down
00025     void setPress(int);     // set the button press
00026     void moveServoIn();   // move servo into the slot
00027     void moveServoOut();  // move servo out of the slot
00028     int getID();
00029     int updateState();
00030     int getState();
00031     int getPress();
00032     int getLp();
00033     void setup();
00034 };
00035 
00036 #endif