Unpredictable behavior occurs if only seven segments pins (that is no decimal point pins) are defined in the array segmentPins[] in the call to the begin() method but the parameter disableDecPoint is omitted.
This could be the case when the decimal point pins of the seven segment displays are not used.
The problem is that the default value of disableDecPoint is false. This leads to the library treating the number of elements in segmentPins[] as 8 even though only 7 elements are present. When the array is later scanned an attempt is made to read the non-existent element number 8 leading to this unpredictable behavior [array out of bounds].
In the specific case recorded at https://forum.arduino.cc/t/2-digit-display-with-sevseg-library-a-segment-staying-on/1230896 the effect of this error was that an unwanted segment on a display remained lit.
Unpredictable behavior occurs if only seven segments pins (that is no decimal point pins) are defined in the array
segmentPins[]in the call to the begin() method but the parameterdisableDecPointis omitted.This could be the case when the decimal point pins of the seven segment displays are not used.
The problem is that the default value of
disableDecPointis false. This leads to the library treating the number of elements insegmentPins[]as 8 even though only 7 elements are present. When the array is later scanned an attempt is made to read the non-existent element number 8 leading to this unpredictable behavior [array out of bounds].In the specific case recorded at https://forum.arduino.cc/t/2-digit-display-with-sevseg-library-a-segment-staying-on/1230896 the effect of this error was that an unwanted segment on a display remained lit.