Working read code with mode button
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Testnew by
Diff: buttonArray.cpp
- Revision:
- 35:3090ec93b4aa
- Parent:
- 34:e87bb6e83072
- Child:
- 36:1248dfa0740b
--- a/buttonArray.cpp Mon Nov 20 15:46:11 2017 +0000 +++ b/buttonArray.cpp Wed Nov 29 00:40:16 2017 +0000 @@ -7,7 +7,7 @@ buttonArray::buttonArray(button b1, button b2, button b3, button b4, button b5, button b6) : button1(b1), button2(b2), button3(b3), button4(b4), button5(b5), button6(b6) {} -Serial pc(USBTX, USBRX); +//Serial pc(USBTX, USBRX); // FUNCTIONS @@ -15,10 +15,11 @@ // braille respresentation here - https://en.wikipedia.org/wiki/Braille_ASCII char buttonArray::checkVal() { - pc.printf(" checkVal \n"); + //pc.printf(" checkVal \n"); char* braille; char val = NULL; - sprintf(braille, "%d%d%d%d%d%d", button1.getPress(), button2.getPress(), + int test = button1.getPress(); + sprintf(braille, "%d%d%d%d%d%d", test, button2.getPress(), button3.getPress(), button4.getPress(), button5.getPress(), button6.getPress()); //pc.printf(" %s \n", braille); if (strcmp(braille, "000000") == 0) val = 'X'; @@ -50,7 +51,7 @@ if (strcmp(braille, "011111") == 0) val = 'Z';*/ // check if reset if (strcmp(braille, "111111") == 0) val = 'Z'; - pc.printf(" %c \n", val); + //pc.printf(" %c \n", val); return val; } @@ -95,7 +96,7 @@ char* inarr = getBraille(input); //pc.printf("input %s\n", inarr); char* actarr = getBraille(actual); - pc.printf("wrong pins"); + //pc.printf("wrong pins"); int j = 1; for (int i = 0; i < 6; i++) { if(inarr[i] == actarr[i]) {