Skip to content

Commit 138062d

Browse files
Support for the degree symbol.
Library interprets asterisk ("*") character as a degree symbol for nice interpretation of teperatures.
1 parent 0e05816 commit 138062d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

SevSeg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define BLANK_IDX 36 // Must match with 'digitCodeMap'
2828
#define DASH_IDX 37
2929
#define PERIOD_IDX 38
30+
#define ASTERISK_IDX 39
3031

3132
static const long powersOf10[] = {
3233
1, // 10^0
@@ -95,6 +96,7 @@ static const byte digitCodeMap[] = {
9596
B00000000, // 32 ' ' BLANK
9697
B01000000, // 45 '-' DASH
9798
B10000000, // 46 '.' PERIOD
99+
B01100011, // 42 '*' DEGREE ..
98100
};
99101

100102
// Constant pointers to constant data
@@ -478,6 +480,9 @@ void SevSeg::setChars(char str[]) {
478480
else if (ch == '.') {
479481
digitCodes[digitNum] = digitCodeMap[PERIOD_IDX];
480482
}
483+
else if (ch == '*') {
484+
digitCodes[digitNum] = digitCodeMap[ASTERISK_IDX];
485+
}
481486
else {
482487
// Every unknown character is shown as a dash
483488
digitCodes[digitNum] = digitCodeMap[DASH_IDX];

0 commit comments

Comments
 (0)