![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
First version
Dependencies: mbed EthernetInterface mbed-rto
Diff: main.cpp
- Revision:
- 51:b9da0ba69a29
- Parent:
- 49:2d592fa1cad5
- Child:
- 53:b6b2910d00e7
diff -r 2d592fa1cad5 -r b9da0ba69a29 main.cpp --- a/main.cpp Wed May 09 11:56:55 2018 +0000 +++ b/main.cpp Wed May 09 12:29:08 2018 +0000 @@ -7,6 +7,7 @@ Ticker flipper; DigitalOut led2(LED2); +LEDDriver *driver; void receive(Queue<int,8>* queue){ printf("receive executed.\r\n"); @@ -15,17 +16,18 @@ receiver.start(); } - -void LEDStart(Queue<int,8>* queue,Ticker* ticker) +/* +void CreateLEDDriver(Queue<int,8>* queue,Ticker* ticker) { printf("LEDStart executed.\r\n"); LEDDriver driver = LEDDriver(queue); printf("LEDDriver created.\r\n"); driver.run(ticker); -} +} */ void flip() { led2 = !led2; + driver->drive(8); } int main (void){ @@ -38,7 +40,7 @@ //threadeth.start(receive,&queue); //driverThread.start(LEDStart,&queue); //} - + driver=new LEDDriver(&queue); flipper.attach(&flip, 0.1); //LEDStart(&queue,&ticker); receive(&queue);