demo versie 16/05

Dependencies:   EthernetInterface mbed-rto mbed

Fork of ProjectVLC by Klaas Govaerts

Committer:
KlaasGovaerts
Date:
Wed Apr 18 14:34:31 2018 +0000
Revision:
21:fe6a58e84929
Parent:
20:4997b02d6a88
Child:
25:4c673da1a3ae
Child:
28:bf62c46acb3e
Pakket ontvangen en interpreteren werkt.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
KlaasGovaerts 0:98e4994363bf 1 #include "mbed.h"
KlaasGovaerts 21:fe6a58e84929 2 #include "rtos.h"
KlaasGovaerts 19:5ee34e60a31d 3 #include "Interpreter.h"
KlaasGovaerts 6:9903a0906a72 4 #include "TCPlistener.h"
KlaasGovaerts 3:1c9645acea2f 5
KlaasGovaerts 3:1c9645acea2f 6 int main (void){
KlaasGovaerts 21:fe6a58e84929 7 int LED[8];
KlaasGovaerts 21:fe6a58e84929 8 for(int i=0;i<8;i++){
KlaasGovaerts 19:5ee34e60a31d 9 LED[i]=-1;
KlaasGovaerts 19:5ee34e60a31d 10 }
KlaasGovaerts 19:5ee34e60a31d 11 Interpreter interpreter(LED);
KlaasGovaerts 19:5ee34e60a31d 12 TCPlistener listener;
KlaasGovaerts 19:5ee34e60a31d 13 char command[512];
KlaasGovaerts 4:0d013b7e4dea 14
KlaasGovaerts 21:fe6a58e84929 15 while(true){
KlaasGovaerts 21:fe6a58e84929 16 listener.receiveSegment(command,sizeof(command));
KlaasGovaerts 21:fe6a58e84929 17 interpreter.executeCommand(command);
KlaasGovaerts 21:fe6a58e84929 18
KlaasGovaerts 21:fe6a58e84929 19 for(int i=0;i<8;i++){
KlaasGovaerts 21:fe6a58e84929 20 printf("LED %i, richting: %i\r\n",i,LED[i]);
KlaasGovaerts 21:fe6a58e84929 21 }
KlaasGovaerts 21:fe6a58e84929 22 }
KlaasGovaerts 4:0d013b7e4dea 23 }