Working read code with mode button
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Testnew by
Diff: buttonArray.cpp
- Revision:
- 21:ceac47be2e64
- Child:
- 22:abbc12fca525
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buttonArray.cpp Fri Oct 27 15:15:00 2017 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "buttonArray.h" + +// button 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) {} +//button::button(PwmOut servo, DigitalIn pb, AnalogIn lp) +// : servo(servo), pb(pb), linpot(lp), mode(0), state(0) {} + +// FUNCTIONS +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; +} \ No newline at end of file