![](/media/cache/profiles/2ac350bd5fbdda63bd410978526a2388.jpg.50x50_q85.png)
Testing with Daniel
Dependencies: mbed Blinker TextLCD
Diff: main.cpp
- Revision:
- 4:62ae68bcaee8
- Parent:
- 3:0432064270e1
- Child:
- 6:d8bc26e7d471
diff -r 0432064270e1 -r 62ae68bcaee8 main.cpp --- a/main.cpp Sat Jan 07 15:04:42 2017 +0000 +++ b/main.cpp Sat Jan 07 16:00:42 2017 +0000 @@ -1,43 +1,27 @@ // Testing MBED with Daniel #include "mbed.h" +#include "Blinker.h" -double getWaitTime(); - +Timer timer; DigitalOut led1(LED1); //DigitalOut greenLed(D8); //DigitalOut redLed(D10); //DigitalIn button(D9); Serial pc(USBTX, USBRX); +jj::Blinker blinker1(led1, timer); -Timer timer; -uint32_t prevMs; -uint32_t currentMs; -uint32_t lastToggleMs = 0; -uint32_t toggleTimeMs = 500; int main() { -// button.mode(PullUp); - timer.start(); - currentMs = prevMs = timer.read_ms(); - pc.baud(115200); pc.printf("Hello world\r\n"); - led1 = 0; + blinker1.blink(200, 1000); for(;;) { - currentMs = timer.read_ms(); -// pc.printf("%ld ms\r\n", currentMs - prevMs); - prevMs = currentMs; - - if (currentMs - lastToggleMs >= toggleTimeMs) - { - led1 = !led1; - lastToggleMs = currentMs; - } + blinker1.update(); } }