From 78c1d056fb49182c2a4b5aa879927d8708298bc1 Mon Sep 17 00:00:00 2001 From: Dean Reading Date: Sat, 13 Feb 2021 16:10:50 -0800 Subject: [PATCH] Correct data type error for setChars --- SevSeg.cpp | 6 +++--- SevSeg.h | 2 +- library.properties | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SevSeg.cpp b/SevSeg.cpp index bf76ade..fbb20fe 100644 --- a/SevSeg.cpp +++ b/SevSeg.cpp @@ -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']; @@ -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++; diff --git a/SevSeg.h b/SevSeg.h index 25ed470..2642b8f 100644 --- a/SevSeg.h +++ b/SevSeg.h @@ -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: diff --git a/library.properties b/library.properties index 1e8c67d..8f9ab18 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SevSeg -version=3.6.0 +version=3.6.1 author=Dean Reading maintainer=Dean Reading sentence=Turns your Arduino into a seven segment display controller!