Skip to content

Commit d9ac062

Browse files
authored
Merge pull request #48 from JurajKavka/degree-symbol-support
Support for the degree symbol.
2 parents e34b969 + 138062d commit d9ac062

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
@@ -480,6 +482,9 @@ void SevSeg::setChars(char str[]) {
480482
else if (ch == '.') {
481483
digitCodes[digitNum] = digitCodeMap[PERIOD_IDX];
482484
}
485+
else if (ch == '*') {
486+
digitCodes[digitNum] = digitCodeMap[ASTERISK_IDX];
487+
}
483488
else {
484489
// Every unknown character is shown as a dash
485490
digitCodes[digitNum] = digitCodeMap[DASH_IDX];

0 commit comments

Comments
 (0)