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.
Dependencies: MMA8452 N5110 PowerControl beep mbed
Diff: Clock.h
- Revision:
- 2:57d1ed1f0ad3
- Child:
- 3:1974db5993ef
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Clock.h Sat May 02 20:29:52 2015 +0000
@@ -0,0 +1,50 @@
+/**
+@ file Clock.h
+
+@ brief Header file of a count down clock containing Ticker on RTC and display time on N5110 Nokia Screen
+*/
+
+#ifndef CLOCK_H
+#define CLOCK_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "MMA8452.h"
+
+int CClock;
+
+class Clock
+{
+private:
+
+ Ticker timer;
+
+public:
+ void CountDown();
+};
+
+void Clock::CountDown()
+{
+
+ if (CClock > 10) {
+ CClock = CClock - 1;
+ char Clockbuffer[14];
+ int Clocklength = sprintf(Clockbuffer," %d", CClock);
+ if (Clocklength < 14) {
+ lcd.printString(Clockbuffer,33,2);
+ }
+ } else if (CClock > 0) {
+ //lcd.clear();
+ CClock = CClock - 1;
+ char Clockbuffer[14];
+ int Clocklength = sprintf(Clockbuffer," %d", CClock);
+ if (Clocklength < 14) {
+ lcd.printString(Clockbuffer,39,2);
+ }
+ } /*else if (CClock == 0) {
+ //lcd.clear();
+ lcd.printString("Time out",33,2);
+ }*/
+}
+
+#endif
\ No newline at end of file