![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
First version
Dependencies: mbed EthernetInterface mbed-rto
main.cpp@58:738f026cf667, 2018-05-09 (annotated)
- Committer:
- KlaasGovaerts
- Date:
- Wed May 09 14:11:26 2018 +0000
- Revision:
- 58:738f026cf667
- Parent:
- 53:b6b2910d00e7
- Child:
- 59:237e32fd3555
Added destructor
Who changed what in which revision?
User | Revision | Line number | New 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 | 29:996da48a265c | 5 | #include "Receiver.h" |
albireo987 | 26:4c673da1a3ae | 6 | #include "LEDDriver.h" |
KlaasGovaerts | 29:996da48a265c | 7 | |
KlaasGovaerts | 49:2d592fa1cad5 | 8 | Ticker flipper; |
KlaasGovaerts | 49:2d592fa1cad5 | 9 | DigitalOut led2(LED2); |
KlaasGovaerts | 51:b9da0ba69a29 | 10 | LEDDriver *driver; |
KlaasGovaerts | 49:2d592fa1cad5 | 11 | |
KlaasGovaerts | 30:915f6cb7ffa5 | 12 | void receive(Queue<int,8>* queue){ |
KlaasGovaerts | 41:b69c7baa5d31 | 13 | printf("receive executed.\r\n"); |
KlaasGovaerts | 29:996da48a265c | 14 | Receiver receiver(queue); |
KlaasGovaerts | 48:c5cd73d93045 | 15 | printf("Receiver Object created.\r\n"); |
KlaasGovaerts | 29:996da48a265c | 16 | receiver.start(); |
KlaasGovaerts | 29:996da48a265c | 17 | } |
KlaasGovaerts | 29:996da48a265c | 18 | |
KlaasGovaerts | 49:2d592fa1cad5 | 19 | void flip() { |
KlaasGovaerts | 49:2d592fa1cad5 | 20 | led2 = !led2; |
KlaasGovaerts | 51:b9da0ba69a29 | 21 | driver->drive(8); |
KlaasGovaerts | 49:2d592fa1cad5 | 22 | } |
KlaasGovaerts | 49:2d592fa1cad5 | 23 | |
KlaasGovaerts | 2:1c9645acea2f | 24 | int main (void){ |
KlaasGovaerts | 41:b69c7baa5d31 | 25 | printf("main executed.\r\n"); |
KlaasGovaerts | 30:915f6cb7ffa5 | 26 | Queue<int,8> queue; |
KlaasGovaerts | 51:b9da0ba69a29 | 27 | driver=new LEDDriver(&queue); |
KlaasGovaerts | 53:b6b2910d00e7 | 28 | flipper.attach(&flip, 0.002f); |
KlaasGovaerts | 44:ffac07bff0d8 | 29 | receive(&queue); |
KlaasGovaerts | 3:0d013b7e4dea | 30 | } |