Working read code with mode button

Dependencies:   SDFileSystem emic2 mbed-rtos mbed

Fork of BAT_senior_design_Testnew by BAT

Revision:
21:ceac47be2e64
Parent:
16:581a3b02f4c3
Child:
23:c5df903f068a
--- a/button.h	Fri Oct 27 13:34:49 2017 +0000
+++ b/button.h	Fri Oct 27 15:15:00 2017 +0000
@@ -1,5 +1,8 @@
 #include "mbed.h"
 
+#ifndef BUTTON_H
+#define BUTTON_H
+
 // This is a button class for our custom button
 class button {
 
@@ -7,20 +10,27 @@
 private:
     PwmOut servo;
     DigitalIn pb;
-    // int state; // is the button up or down
+    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
-    //int getState();     // determine what state the button is in - up or down
+    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
-};
\ No newline at end of file
+    int updateState();
+    int getState();
+    int getPress();
+};
+
+#endif
\ No newline at end of file