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 1:bb3ab1744634, committed 2019-04-15
- Comitter:
- JamB
- Date:
- Mon Apr 15 14:48:44 2019 +0000
- Parent:
- 0:293ea2789df6
- Commit message:
- updae
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 |
--- a/clock.cpp Thu Apr 11 22:17:06 2019 +0000
+++ b/clock.cpp Mon Apr 15 14:48:44 2019 +0000
@@ -1,8 +1,9 @@
#include "mbed.h"
#include "clock.h"
bool istick;
+ bool istickdisp;
Ticker ticker; //class, instance of class
-
+ Ticker tickerDisp;
void tick()
{
istick=true;
@@ -22,4 +23,24 @@
}
return false;
}
+
+
+void tickdisp()
+{
+ istickdisp=true;
+}
+
+void set_tick_disp(float set_tickdisp) //constructor
+{ //used to setup the clock
+ tickerDisp.attach(&tickdisp, set_tickdisp);
+}
+bool tockdisp()
+{ //used to run the code
+ if (istickdisp)
+ {
+ istickdisp =false;
+ return true;
+ }
+ return false;
+}
--- a/clock.h Thu Apr 11 22:17:06 2019 +0000
+++ b/clock.h Mon Apr 15 14:48:44 2019 +0000
@@ -2,4 +2,7 @@
void tick();
bool tock(void);
void set_tick_(float set_tick);
-
\ No newline at end of file
+
+ void tickdisp();
+ bool tockdisp(void);
+ void set_tick_disp(float set_tickdisp);
\ No newline at end of file