Lennart van Hoorne
/
State_Eat
Zonder parameters uit de EMG
Revision 0:0bbc5cf3d9a5, committed 2018-10-31
- Comitter:
- LennartvanHoorne
- Date:
- Wed Oct 31 22:59:14 2018 +0000
- Commit message:
- Zonder parameters
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 31 22:59:14 2018 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" + +// Function for the case when the patient wants to eat and therefore the spoon must be still + +// In het kort is het zo dat er een functie moet worden gemaakt die op wait staat tot er weer op nieuw met beide spieren aangespannen wordt +// Het handigst is om hiervoor een condititional if statement te gebruiken. Zodat hij gereactiveerd kan worden + +bool EMG1 = false; +bool EMG2 = false; + +void do_state_eating(){ + if ((EMG1 == true) && (EMG2 == true)) { + bool switched1 = false; + bool switched2 = false; + while (switched2 == false) { + wait(0.1); + if ((EMG1 == false) || (EMG2 == false)) { + switched1 = true; + } else if (switched1 == true) { + switched2 = true; + } + } + } +} + +int main(){ + + + do_state_eating(); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 31 22:59:14 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file