Nathan Yonkee / Mbed OS Seeed_Grove_4_Digit_Display_Clock

Dependencies:   Data_Clock_Pair Seeed_Chainable_LED Seeed_Four_Digit_Disp Seeed_IR_Temp_Sensor Seeed_Led_Bar

Fork of Seeed_Grove_4_Digit_Display_Clock by Seeed

Revision:
15:abda719ba6e6
Parent:
12:a16d86fac131
diff -r 1139e6439f93 -r abda719ba6e6 SeeedFourDigitDisp.h
--- a/SeeedFourDigitDisp.h	Thu Apr 27 16:10:16 2017 -0600
+++ b/SeeedFourDigitDisp.h	Thu May 18 10:47:08 2017 -0600
@@ -5,7 +5,12 @@
 
 class SeeedFourDigitDisp {
   private:
-    int digitTable_[17];
+    int digitTable_[17] = {0x3f, 0x06, 0x5b, 0x4f,
+                          0x66, 0x6d, 0x7d, 0x07,
+                          0x7f, 0x6f, 0x77, 0x7c,
+                          0x39, 0x5e, 0x79, 0x71,
+                          0x00
+                         };
     static const int onByte_ = 0x88;
     static const int fixedAddrByte_ = 0x44;
     static const int positionBit_ = 0xc0;
@@ -18,8 +23,8 @@
     void pin_delay(int delay_us = 1);
     void send_byte(int byte);
   public:
-    int brightness;
-    bool colonFlag;
+    int brightness = 7;
+    bool colonFlag = false;
     void set_digit(int pos, int digit);
     void set_integer(int value);
     void clear_display();
@@ -28,17 +33,6 @@
 };
 
 SeeedFourDigitDisp::SeeedFourDigitDisp(DataClockPair pins) : datPin_(pins.dataPin, 1), clkPin_(pins.clockPin, 1) {
-    brightness = 7;
-    colonFlag = false;
-    const int digits[] = {0x3f, 0x06, 0x5b, 0x4f,
-                          0x66, 0x6d, 0x7d, 0x07,
-                          0x7f, 0x6f, 0x77, 0x7c,
-                          0x39, 0x5e, 0x79, 0x71,
-                          0x00
-                         }; //0~9,A,b,C,d,E,F,null
-    for (int i = 0; i < 17; ++i) {
-        digitTable_[i] = digits[i];
-    }
     clear_display();
 }