![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Working read code with mode button
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Testnew by
buttonArray.cpp@22:abbc12fca525, 2017-10-27 (annotated)
- Committer:
- aismail1997
- Date:
- Fri Oct 27 15:18:28 2017 +0000
- Revision:
- 22:abbc12fca525
- Parent:
- 21:ceac47be2e64
- Child:
- 23:c5df903f068a
added comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aismail1997 | 21:ceac47be2e64 | 1 | #include "mbed.h" |
aismail1997 | 21:ceac47be2e64 | 2 | #include "buttonArray.h" |
aismail1997 | 21:ceac47be2e64 | 3 | |
aismail1997 | 22:abbc12fca525 | 4 | // buttonArray constructor |
aismail1997 | 21:ceac47be2e64 | 5 | buttonArray::buttonArray(button b1, button b2, button b3, button b4, button b5, button b6) |
aismail1997 | 21:ceac47be2e64 | 6 | : button1(b1), button2(b2), button3(b3), button4(b4), button5(b5), button6(b6) {} |
aismail1997 | 22:abbc12fca525 | 7 | |
aismail1997 | 22:abbc12fca525 | 8 | // FUNCTIONS |
aismail1997 | 21:ceac47be2e64 | 9 | |
aismail1997 | 22:abbc12fca525 | 10 | // map input braille to ascii |
aismail1997 | 21:ceac47be2e64 | 11 | int buttonArray::checkVal() { |
aismail1997 | 21:ceac47be2e64 | 12 | char* val; |
aismail1997 | 21:ceac47be2e64 | 13 | sprintf(val, "%d%d%d%d%d%d", button1.getPress(), button2.getPress(), |
aismail1997 | 21:ceac47be2e64 | 14 | button3.getPress(), button4.getPress(), button5.getPress(), button6.getPress()); |
aismail1997 | 21:ceac47be2e64 | 15 | if (val == "000000") |
aismail1997 | 21:ceac47be2e64 | 16 | return 1; |
aismail1997 | 21:ceac47be2e64 | 17 | else |
aismail1997 | 21:ceac47be2e64 | 18 | return 0; |
aismail1997 | 21:ceac47be2e64 | 19 | } |