Zonder parameters uit de EMG

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 // Function for the case when the patient wants to eat and therefore the spoon must be still
00004 
00005 // 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
00006 // Het handigst is om hiervoor een condititional if statement te gebruiken. Zodat hij gereactiveerd kan worden
00007 
00008 bool EMG1 = false;
00009 bool EMG2 = false;
00010 
00011 void do_state_eating(){
00012     if ((EMG1 == true) && (EMG2 == true)) {
00013         bool switched1 = false;
00014         bool switched2 = false;
00015         while (switched2 == false) {
00016             wait(0.1);
00017             if ((EMG1 == false) || (EMG2 == false)) {
00018                 switched1 = true;
00019             } else if (switched1 == true) {
00020                 switched2 = true;
00021             }
00022         }
00023     }
00024 }    
00025     
00026 int main(){
00027     
00028     
00029     do_state_eating();
00030 }