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.
Diff: clock.cpp
- Revision:
- 1:bb3ab1744634
- Parent:
- 0:293ea2789df6
diff -r 293ea2789df6 -r bb3ab1744634 clock.cpp
--- 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;
+}