First version

Dependencies:   mbed EthernetInterface mbed-rto

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

Who changed what in which revision?

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