Fork of original senior design repo

Dependencies:   SDFileSystem mbed-rtos mbed wave_player emic2

Fork of BAT_senior_design by BAT

buttonArray.cpp

Committer:
aismail1997
Date:
2017-10-27
Revision:
19:abbc12fca525
Parent:
18:ceac47be2e64
Child:
20:c5df903f068a

File content as of revision 19:abbc12fca525:

#include "mbed.h"
#include "buttonArray.h"

// buttonArray constructor
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) {}
    
// FUNCTIONS

// map input braille to ascii
int buttonArray::checkVal() {
    char* val;
    sprintf(val, "%d%d%d%d%d%d", button1.getPress(), button2.getPress(),
     button3.getPress(), button4.getPress(), button5.getPress(), button6.getPress());
    if (val == "000000")
        return 1;
    else 
        return 0;
}