![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Fixed wait time
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Nhi by
Diff: buttonArray.cpp
- Revision:
- 23:23970cf718ee
- Parent:
- 22:6931917c70cd
- Child:
- 27:b2e53ce54b3e
--- a/buttonArray.cpp Fri Nov 03 18:56:01 2017 +0000 +++ b/buttonArray.cpp Fri Nov 10 15:59:21 2017 +0000 @@ -62,18 +62,18 @@ } // return an array of which pins need to be up -int* buttonArray::pinsToPress(char val) +int* buttonArray::pinsUp(char val) { - int* pinstopress; + int* pinsup; char* braille = getBraille(val); int j = 0; for (int i = 0; i < 6; i++) { if (braille[i] == '0') { - pinstopress[j] = i; + pinsup[j] = i+1; j++; } } - return pinstopress; + return pinsup; } // return feedback on which pins need to be corrected @@ -81,11 +81,15 @@ int* buttonArray::wrongPins(char input, char actual) { if (input == NULL) return NULL; - int wrong[6]; + int* wrong; char* inarr = getBraille(input); char* actarr = getBraille(actual); + int j = 0; for (int i = 0; i < 6; i++) { - wrong[i] = (inarr[i] != actarr[i]); + if(inarr[i] != actarr[i]) { + wrong[j] = i+1; + j++; + } } return wrong; }