Pacemaker code Implementation for SFWRENG 3K04
Dependencies: mbed Queue mbed-rtos FXOS8700Q
Fork of Pacemaker by
SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.
The project uses the Freescale K64F Microcontroller and C++ mbed library.
Diff: interface.cpp
- Revision:
- 22:19b187e345c9
- Parent:
- 20:bfd23a6845bb
- Parent:
- 21:fc6c33206152
- Child:
- 23:719584670460
diff -r bfd23a6845bb -r 19b187e345c9 interface.cpp --- a/interface.cpp Thu Nov 24 03:26:14 2016 +0000 +++ b/interface.cpp Thu Nov 24 03:42:12 2016 +0000 @@ -256,7 +256,46 @@ break; } } - + +void interface::getData(chamberData* chamber){ + char command = getChar(); + switch (command){ + case '1': + pc->printf("\nChoose New Value:"); + char* value = getInput(); + chamber->chngPaceAmp(atof(value)); + pc->printf("\t%f",chamber->getPaceAmp()*7); + interface::dataScreen(); + break; + case '2': + pc->printf("\nChoose New Value:"); + value = getInput(); + chamber->chngPaceWidth(atof(value)); + pc->printf("\t%f",chamber->getPaceWidth()); + interface::dataScreen(); + break; + case '3': + pc->printf("\nChoose New Value:"); + value = getInput(); + chamber->chngRP(atof(value)); + pc->printf("\t%f",chamber->getRP()); + interface::dataScreen(); + break; + case '4': + pc->printf("\nChoose New Value:"); + value = getInput(); + chamber->chngSensitivity(atof(value)); + pc->printf("\t%f",chamber->getSensitivity()); + interface::dataScreen(); + break; + case '5': + interface::dataScreen(); + break; + default: + pc->printf("\nThat is not an option."); + interface::getData(chamber); + } + } char* interface::getInput(){ char buffer[5]; fgets (buffer,5,stdin);