Skip to content

Commit

Permalink
Correct data type error for setChars
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanIsMe committed Feb 14, 2021
1 parent 8fb836b commit 78c1d05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions SevSeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,14 @@ void SevSeg::getSegments(uint8_t segs[]) {
/******************************************************************************/
// Displays the string on the display, as best as possible.
// Only alphanumeric characters plus '-' and ' ' are supported
void SevSeg::setChars(const int8_t str[]) {
void SevSeg::setChars(const char str[]) {
for (uint8_t digit = 0; digit < numDigits; digit++) {
digitCodes[digit] = 0;
}

uint8_t strIdx = 0; // Current position within str[]
for (uint8_t digitNum = 0; digitNum < numDigits; digitNum++) {
int8_t ch = str[strIdx];
char ch = str[strIdx];
if (ch == '\0') break; // NULL string terminator
if (ch >= '0' && ch <= '9') { // Numerical
digitCodes[digitNum] = numeralCodes[ch - '0'];
Expand Down Expand Up @@ -487,7 +487,7 @@ void SevSeg::setChars(const int8_t str[]) {
}

strIdx++;
// Peek at next character. It it's a period, add it to this digit
// Peek at next character. If it's a period, add it to this digit
if (str[strIdx] == '.') {
digitCodes[digitNum] |= digitCodeMap[PERIOD_IDX];
strIdx++;
Expand Down
2 changes: 1 addition & 1 deletion SevSeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SevSeg

void setSegments(const uint8_t segs[]);
void getSegments(uint8_t segs[]);
void setChars(const int8_t str[]);
void setChars(const char str[]);
void blank(void);

private:
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SevSeg
version=3.6.0
version=3.6.1
author=Dean Reading <deanreading@hotmail.com>
maintainer=Dean Reading <deanreading@hotmail.com>
sentence=Turns your Arduino into a seven segment display controller!
Expand Down

0 comments on commit 78c1d05

Please sign in to comment.