Working read code with mode button
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Testnew by
Diff: buttonArray.cpp
- Revision:
- 33:e5024aeca3a7
- Parent:
- 32:79cdf893c8b8
- Child:
- 34:e87bb6e83072
--- a/buttonArray.cpp Fri Nov 17 15:17:36 2017 +0000 +++ b/buttonArray.cpp Fri Nov 17 16:24:33 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,7 +15,7 @@ // 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(), @@ -50,7 +50,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,10 +95,10 @@ 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]) { + if(inarr[i] == actarr[i]) { wrong[j] = i+1; //pc.printf("%d ", wrong[j]); j++;