Working read code with mode button
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Testnew by
button.h@16:581a3b02f4c3, 2017-10-22 (annotated)
- Committer:
- aismail1997
- Date:
- Sun Oct 22 22:20:11 2017 +0000
- Revision:
- 16:581a3b02f4c3
- Parent:
- 15:b80dde24e9bc
- Child:
- 21:ceac47be2e64
Last working code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aismail1997 | 12:21268d8bf979 | 1 | #include "mbed.h" |
aismail1997 | 12:21268d8bf979 | 2 | |
aismail1997 | 15:b80dde24e9bc | 3 | // This is a button class for our custom button |
aismail1997 | 12:21268d8bf979 | 4 | class button { |
aismail1997 | 12:21268d8bf979 | 5 | |
aismail1997 | 15:b80dde24e9bc | 6 | // pins connected to the button |
aismail1997 | 12:21268d8bf979 | 7 | private: |
aismail1997 | 12:21268d8bf979 | 8 | PwmOut servo; |
aismail1997 | 12:21268d8bf979 | 9 | DigitalIn pb; |
aismail1997 | 16:581a3b02f4c3 | 10 | // int state; // is the button up or down |
aismail1997 | 15:b80dde24e9bc | 11 | // int mode; // is the system in reading or typing mode |
aismail1997 | 16:581a3b02f4c3 | 12 | // AnalogIn linpot; |
aismail1997 | 15:b80dde24e9bc | 13 | |
aismail1997 | 12:21268d8bf979 | 14 | public: |
aismail1997 | 12:21268d8bf979 | 15 | // constructors |
aismail1997 | 16:581a3b02f4c3 | 16 | button(); // Default |
aismail1997 | 12:21268d8bf979 | 17 | button(PwmOut servo, DigitalIn pb); |
aismail1997 | 16:581a3b02f4c3 | 18 | // button(PwmOut servo, DigitalIn pb, AnalogIn linpot); |
aismail1997 | 12:21268d8bf979 | 19 | // functions |
aismail1997 | 15:b80dde24e9bc | 20 | PwmOut getServoPin(); // get the servo pin |
aismail1997 | 16:581a3b02f4c3 | 21 | //void setState(int state); // set state |
aismail1997 | 16:581a3b02f4c3 | 22 | //void setMode(int mode); // set mode |
aismail1997 | 15:b80dde24e9bc | 23 | //int getState(); // determine what state the button is in - up or down |
aismail1997 | 15:b80dde24e9bc | 24 | void moveServoIn(); // move servo into the slot |
aismail1997 | 15:b80dde24e9bc | 25 | void moveServoOut(); // move servo out of the slot |
aismail1997 | 12:21268d8bf979 | 26 | }; |