このライブラリは1桁から8桁までのSeven segment Numeric LEDを制御します。 LEDはanode commonとcathode common を使用することができます。 LEDの表示は1秒で表示をスムースに切り替えるモードと、直ぐに切り替えるモードの2つのモードを選択することができます。 This library to control the Seven segment Numeric LED 8 digit of 1. You can use the LED cathode common and anode common. Switch mode LED display and a second displayed a smooth, you can choose two modes to switch modes quickly.
Dependents: kitchenTimer_Clock kitchenTimer LPC1114FN28_kitchenTimer_Clock SevenSegmentLedSample ... more
Diff: SevenSegLed.cpp
- Revision:
- 6:a1eb5de4146f
- Parent:
- 5:a7ba72bf10ba
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 }