![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
demo versie 16/05
Dependencies: EthernetInterface mbed-rto mbed
Fork of ProjectVLC by
Diff: Interpreter.cpp
- Revision:
- 21:fe6a58e84929
- Parent:
- 19:5ee34e60a31d
- Child:
- 28:bf62c46acb3e
--- a/Interpreter.cpp Wed Apr 18 13:58:46 2018 +0000 +++ b/Interpreter.cpp Wed Apr 18 14:34:31 2018 +0000 @@ -5,7 +5,7 @@ } void Interpreter::executeCommand(char* command){ - char *ID=strtok(command,","); + char *ID=strtok(command,"-"); char *direction=strtok(NULL," "); while((ID!=NULL)&&(direction!=NULL)){ int IDNumber=atoi(ID); @@ -15,19 +15,19 @@ LED[IDNumber]=directionNumber; //lock->unlock(); } - ID=strtok(NULL,","); + ID=strtok(NULL,"-"); direction=strtok(NULL," "); } } int Interpreter::directionToNumber(char* direction){ - if(strcmp(direction,"links")==0) + if(strcmp(direction,"left")==0) return 0; - else if(strcmp(direction,"rechts")==0) + else if(strcmp(direction,"right")==0) return 1; - else if(strcmp(direction,"boven")==0) + else if(strcmp(direction,"up")==0) return 2; - else if(strcmp(direction,"onder")==0) + else if(strcmp(direction,"down")==0) return 3; else return -1;