James Bartholomew / Clock2

Files at this revision

API Documentation at this revision

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