Charles Young's development fork. Going forward I only want to push mature code to main repository.
Fork of GEO_COUNTER_L432KC by
Diff: LED7segDisplay.cpp
- Revision:
- 41:08bf3ea5eba4
- Parent:
- 29:3a2152a3a9d1
- Child:
- 44:a26ca542ae5e
--- a/LED7segDisplay.cpp Thu Sep 06 10:15:48 2018 -0700 +++ b/LED7segDisplay.cpp Thu Sep 06 10:42:07 2018 -0700 @@ -51,6 +51,24 @@ //--------------------------------------------------------------------------- // Refresh the 6 digits of the main display + +//--------------------------------------------------------------------------- +// Refresh the 2 digits of the gate display + +void LED7segDisplay::Display_2D_Blank() +{ + uint16_t data_to_send; + + for(uint8_t digit = 7; digit < 9; digit++) + { + // each stream consists of digit address and data to show + data_to_send = digit; + data_to_send<<=8; + data_to_send = data_to_send | 0x7F; + sendDataToDisplay(data_to_send); + } +} + void LED7segDisplay::Display_6D_write(uint32_t value) { @@ -59,7 +77,6 @@ char TextString[6]; // int to string, then string to digits - sprintf(TextString, "%6d", value); // int to string for(uint8_t i=0; i<6; i++) @@ -70,11 +87,6 @@ Disp_Digit[i] = TextString[i]-'0'; } - // write to chip - - SCK = 0; - wait_us(DT); - for(digit = 1; digit <7; digit++) { // each stream consists of digit address and data to show @@ -87,19 +99,13 @@ return; } - -//--------------------------------------------------------------------------- -// Refresh the 2 digits of the gate display - void LED7segDisplay::Display_2D_write(unsigned short value) { - uint8_t digit; uint16_t data_to_send; char TextString[2]; // int to string, then string to digits - sprintf(TextString, "%2d", value); // int to string if(TextString[0] == ' ') // blank empty digits @@ -109,11 +115,6 @@ Disp_Digit[6] = TextString[1] - '0'; - // write to chip - - SCK = 0; - wait_us(DT); - for(digit = 7; digit <9; digit++) { // each stream consists of digit address and data to show