suu pen / SevenSegLed

Dependents:   kitchenTimer_Clock kitchenTimer LPC1114FN28_kitchenTimer_Clock SevenSegmentLedSample ... more

Files at this revision

API Documentation at this revision

Comitter:
suupen
Date:
Fri Dec 27 23:23:34 2013 +0000
Parent:
5:a7ba72bf10ba
Commit message:
This edition, was modified to perform in the Library side dynamic output processing.

Changed in this revision

SevenSegLed.cpp Show annotated file Show diff for this revision Revisions of this file
SevenSegLed.h Show annotated file Show diff for this revision Revisions of this file
diff -r a7ba72bf10ba -r a1eb5de4146f SevenSegLed.cpp
--- a/SevenSegLed.cpp	Sat Nov 30 23:59:26 2013 +0000
+++ b/SevenSegLed.cpp	Fri Dec 27 23:23:34 2013 +0000
@@ -27,8 +27,8 @@
      _com_1(com_1), _com_2(com_2), _com_3(com_3), _com_4(com_4), _com_5(com_5), _com_6(com_6), _com_7(com_7), _com_8(com_8){
 #endif // USECOM4
     
-    timer.attach_us(this, &SevenSegLed::segmentGrayDataKosin, 10000);       // led smooth control 10ms timer inttruupt
-    
+//@SS131223    timer.attach_us(this, &SevenSegLed::segmentGrayDataKosin, 10000);       // led smooth control 10ms timer inttruupt   //@SS131223
+    timer.attach_us(this, &SevenSegLed::output, 1000);       // led output process 1ms timer inttruupt      //@SS131223
     // data table set of Brightness
     // DT_pwmGray[] = i ^ 2
     for(uint32_t i = 0; i < Z_grayMax + 1; i++){
@@ -175,7 +175,7 @@
  
         // dynamic shuturyoku shori
  //segmentGrayDataKosin();
-        output();
+ //@SS131223       output();        //@SS131223
 }
 
 
@@ -260,11 +260,13 @@
 /**************************************
 * output
 *
-* dynamic dosa saseru.
-* kono kansu wo jiikou suru tabi ni common pin o kirikaeru
+* This function must be treated with 1ms interval.
+* Each time you run this function, to switch the common.
+* 
 **************************************/
 void SevenSegLed::output(void){
     static uint8_t M_seg = 0;
+    static uint8_t count = 0;   // This counter is used to perform a single smooth processing 10ms
 
     if(M_seg >= D_comNull){M_seg = 0;}
 
@@ -318,6 +320,13 @@
 //    segAllClear();
     M_seg++;
 
+    // gray data process                                //@SS131223
+    // It is performed in 10ms intervals smooth process //@SS131223
+    count++;                                            //@SS131223
+    if(count > 9){                                      //@SS131223
+        count = 0;                                      //@SS131223
+        segmentGrayDataKosin();                         //@SS131223
+    }                                                   //@SS131223
 }
 
 
diff -r a7ba72bf10ba -r a1eb5de4146f SevenSegLed.h
--- a/SevenSegLed.h	Sat Nov 30 23:59:26 2013 +0000
+++ b/SevenSegLed.h	Fri Dec 27 23:23:34 2013 +0000
@@ -27,6 +27,7 @@
 //* ---------   V1.0 : 4digit(4com) display                             */
 //* ---------   V2.0 : 8digit(8com) display                             */
 //* @SS131130   V2.1 : HYOJI MODE NO TUIKA (smooth or hard)             */
+//* @SS131223   V2.2 : Run the library side dynamic output processing   */
 //*                                                                     */
 //***********************************************************************/
 #ifndef _SEVENSEGLED_H