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:
- 44:a26ca542ae5e
- Parent:
- 41:08bf3ea5eba4
diff -r f330ec39b8b4 -r a26ca542ae5e LED7segDisplay.cpp --- a/LED7segDisplay.cpp Thu Sep 06 10:59:42 2018 -0700 +++ b/LED7segDisplay.cpp Thu Sep 06 11:44:05 2018 -0700 @@ -69,7 +69,7 @@ } } -void LED7segDisplay::Display_6D_write(uint32_t value) +void LED7segDisplay::Display_6D_write(int32_t value) { uint8_t digit; @@ -99,8 +99,13 @@ return; } -void LED7segDisplay::Display_2D_write(unsigned short value) +void LED7segDisplay::Display_2D_write(int16_t value) { + bool negative = false; + if (value < 0) + negative = true; + value = abs(value); + uint8_t digit; uint16_t data_to_send; char TextString[2]; @@ -114,6 +119,9 @@ Disp_Digit[7] = TextString[0] - '0'; Disp_Digit[6] = TextString[1] - '0'; + // turn on decimal point to indicate negative + if (negative) + Disp_Digit[6] |= 0x80; for(digit = 7; digit <9; digit++) {