The clock code
Dependencies: mbed
Revision 2:f094dec67cd1, committed 2017-05-23
- Comitter:
- qdanilc
- Date:
- Tue May 23 11:45:54 2017 +0000
- Parent:
- 1:fd9390d59320
- Commit message:
- Cleaned up a bit;
Changed in this revision
ClockController.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r fd9390d59320 -r f094dec67cd1 ClockController.cpp --- a/ClockController.cpp Tue May 23 11:37:23 2017 +0000 +++ b/ClockController.cpp Tue May 23 11:45:54 2017 +0000 @@ -2,14 +2,9 @@ Ticker clockChange; DigitalOut led1(LED1); -DigitalOut led2(LED2); int newTime; -void flip() { - led2 = !led2; -} - int getTime() { //gets time from internet return 3; @@ -22,11 +17,10 @@ } int runClock(){ - led2 = 1; + clockChange.attach(&changeTime, 1.0); // change the time every second - // spin in a main loop. flipper will interrupt it to call flip - while(1) { + while(1) { // a random loop to show this is active led1 = !led1; wait(0.5); }