Working read code with mode button

Dependencies:   SDFileSystem emic2 mbed-rtos mbed

Fork of BAT_senior_design_Testnew by BAT

Committer:
nnguyen45
Date:
Tue Dec 05 03:31:58 2017 +0000
Revision:
43:82d67fb53e61
Parent:
1:f3d363ca2343
Working with mode button

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nnguyen45 0:5887cb744114 1 #include "mbed.h"
nnguyen45 0:5887cb744114 2
nnguyen45 0:5887cb744114 3 #ifndef BUTTON_H
nnguyen45 0:5887cb744114 4 #define BUTTON_H
nnguyen45 0:5887cb744114 5
nnguyen45 0:5887cb744114 6 // This is a button class for our custom button
nnguyen45 0:5887cb744114 7 class button {
nnguyen45 0:5887cb744114 8
nnguyen45 0:5887cb744114 9 // pins connected to the button
nnguyen45 0:5887cb744114 10 private:
nnguyen45 0:5887cb744114 11 PwmOut servo;
nnguyen45 0:5887cb744114 12 DigitalIn pb;
nnguyen45 0:5887cb744114 13 int state; // where is the button (0 - 4)
nnguyen45 0:5887cb744114 14 int press; // is the button up or down
nnguyen45 0:5887cb744114 15 int id; // this is the ID, each button should have a unique id
nnguyen45 43:82d67fb53e61 16 // int mode; // is the system in reading or typing mode
nnguyen45 43:82d67fb53e61 17 //AnalogIn linpot;
nnguyen45 0:5887cb744114 18
nnguyen45 0:5887cb744114 19 public:
nnguyen45 0:5887cb744114 20 // constructors
nnguyen45 0:5887cb744114 21 button(); // Default
nnguyen45 0:5887cb744114 22 button(PwmOut servo, DigitalIn pb, int id);
nnguyen45 43:82d67fb53e61 23 //button(PwmOut servo, DigitalIn pb, AnalogIn linpot);
nnguyen45 0:5887cb744114 24
nnguyen45 43:82d67fb53e61 25 // button(PwmOut servo, DigitalIn pb, AnalogIn linpot);
nnguyen45 0:5887cb744114 26 // functions
nnguyen45 0:5887cb744114 27 PwmOut getServoPin(); // get the servo pin
nnguyen45 43:82d67fb53e61 28 //void setState(int state); // set state
nnguyen45 43:82d67fb53e61 29 //void setMode(int mode); // set mode
nnguyen45 0:5887cb744114 30 void setState(int); // set what state the button is in - up or down
nnguyen45 0:5887cb744114 31 void setPress(int); // set the button press
nnguyen45 0:5887cb744114 32 void moveServoIn(); // move servo into the slot
nnguyen45 0:5887cb744114 33 void moveServoOut(); // move servo out of the slot
nnguyen45 0:5887cb744114 34 int getID();
nnguyen45 0:5887cb744114 35 int updateState();
nnguyen45 0:5887cb744114 36 int getState();
nnguyen45 0:5887cb744114 37 int getPress();
nnguyen45 0:5887cb744114 38 int getLp();
nnguyen45 0:5887cb744114 39 void setup();
nnguyen45 0:5887cb744114 40 };
nnguyen45 0:5887cb744114 41
nnguyen45 0:5887cb744114 42 #endif