Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:293ea2789df6, committed 2019-04-11
- Comitter:
- JamB
- Date:
- Thu Apr 11 22:17:06 2019 +0000
- Commit message:
- Clock code for project
Changed in this revision
clock.cpp | Show annotated file Show diff for this revision Revisions of this file |
clock.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 293ea2789df6 clock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock.cpp Thu Apr 11 22:17:06 2019 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "clock.h" + bool istick; + Ticker ticker; //class, instance of class + +void tick() +{ + istick=true; +} + +void set_tick_(float set_tick) //constructor +{ //used to setup the clock + ticker.attach(&tick, set_tick); +} + +bool tock() +{ //used to run the code + if (istick) + { + istick =false; + return true; + } + return false; +} +
diff -r 000000000000 -r 293ea2789df6 clock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clock.h Thu Apr 11 22:17:06 2019 +0000 @@ -0,0 +1,5 @@ +#include "mbed.h" + void tick(); + bool tock(void); + void set_tick_(float set_tick); + \ No newline at end of file