LED Digital Clock

Dependents:   IF-SmartClock

Committer:
takashikojo
Date:
Fri Oct 23 05:51:12 2015 +0000
Revision:
4:3b57eeb896a2
Parent:
3:ad3301aff314
Initial public version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takashikojo 0:ae969dd370ab 1 #ifndef DIGITALCLOCK_H
takashikojo 0:ae969dd370ab 2 #define DIGITALCLOCK_H
takashikojo 0:ae969dd370ab 3
takashikojo 1:3c9a2c4733fa 4 #include "FourDigitLED.h"
takashikojo 0:ae969dd370ab 5
takashikojo 2:c374349d4902 6 class DigitalClock : public FourDigitLED {
takashikojo 0:ae969dd370ab 7 public:
takashikojo 0:ae969dd370ab 8 DigitalClock
takashikojo 0:ae969dd370ab 9 (PinName seg0, PinName seg1, PinName seg2, PinName seg3, PinName seg4, PinName seg5, PinName seg6,
takashikojo 0:ae969dd370ab 10 PinName dot, PinName digit0, PinName digit1, PinName digit2, PinName digit3) ;
takashikojo 0:ae969dd370ab 11 ~DigitalClock();
takashikojo 0:ae969dd370ab 12 void start(void) ;
takashikojo 0:ae969dd370ab 13 void stop(void) ;
takashikojo 0:ae969dd370ab 14 void flashLED(void) ;
takashikojo 0:ae969dd370ab 15 bool setLED(int h, int min) ;
takashikojo 1:3c9a2c4733fa 16 void setBlink(bool) ;
takashikojo 2:c374349d4902 17 void setOptVal(const int index, const unsigned int v[], int times) ;
takashikojo 2:c374349d4902 18 bool optionActive ;
takashikojo 3:ad3301aff314 19 int optionCount ;
takashikojo 3:ad3301aff314 20 void poll(void) ;
takashikojo 2:c374349d4902 21
takashikojo 0:ae969dd370ab 22 private:
takashikojo 0:ae969dd370ab 23 // void secTick(void) ;
takashikojo 0:ae969dd370ab 24 int hour ;
takashikojo 0:ae969dd370ab 25 int min ;
takashikojo 0:ae969dd370ab 26 int sec ;
takashikojo 0:ae969dd370ab 27 int maxHour ;
takashikojo 1:3c9a2c4733fa 28 bool blink ;
takashikojo 2:c374349d4902 29 int basePulse ;
takashikojo 3:ad3301aff314 30 bool updateLED ;
takashikojo 2:c374349d4902 31
takashikojo 2:c374349d4902 32 #define AC_OPTION_NUM (16*4)
takashikojo 2:c374349d4902 33 unsigned int optVal[AC_OPTION_NUM][4] ;
takashikojo 2:c374349d4902 34 int optTimes[AC_OPTION_NUM] ;
takashikojo 2:c374349d4902 35 int optNum ;
takashikojo 0:ae969dd370ab 36 SegmentValue now ;
takashikojo 0:ae969dd370ab 37 Ticker Second ;
takashikojo 0:ae969dd370ab 38 FourDigitLED *led ;
takashikojo 0:ae969dd370ab 39 } ;
takashikojo 0:ae969dd370ab 40
takashikojo 0:ae969dd370ab 41 #endif