Words in Typing mode FINAL

Dependencies:   SDFileSystem emic2 mbed-rtos mbed

Fork of BAT_Type_word by BAT

Committer:
aismail1997
Date:
Tue Dec 05 16:46:37 2017 +0000
Revision:
44:9ccc9f8524fd
Parent:
41:560ee7866781
works FINAL

Who changed what in which revision?

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