I am using sevseg and i can't get more than 8 digits to work. I really need 15. Does somebody know what I can do to get this?
Shown is the original example
This is using Gabriel Staples example in the sevseg library:
#include <SevSeg.h>
SevSeg sevseg; //Instantiate a seven segment controller object
void setup()
{
byte numDigits = 4; //<<---I am wanting 15, but doesn't work after 8------
byte digitPins[] = {2, 3, 4, 5}; //Digits: 1,2,3,4 <--put one resistor (ex: 220 Ohms, or 330 Ohms, etc, on each digit pin)
byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13}; //Segments: A,B,C,D,E,F,G,Period
sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins);
// Note: 100 brightness simply corresponds to a delay of 2000us after lighting each segment. A brightness of 0
// is a delay of 1us; it doesn't really affect brightness as much as it affects update rate (frequency).
// Therefore, for a 4-digit 7-segment + pd, COMMON_ANODE display, the max update rate for a "brightness" of 100 is 1/(2000us*8) = 62.5Hz.
// I am choosing a "brightness" of 10 because it increases the max update rate to approx. 1/(200us*8) = 625Hz.
// This is preferable, as it decreases aliasing when recording the display with a video camera....I think.
sevseg.setBrightness(10);
}
void loop()
{
//local vars
static byte decPlace = 0;
sevseg.setNumber(8888,decPlace);
decPlace++;
decPlace %= 4; //rollover back to 0 once variable gets to 4; To anyone wondering: the % is called the "modulo" operator; see here for explanation & example: https://www.arduino.cc/en/Reference/Modulo
sevseg.refreshDisplay(); // Must run repeatedly; don't use blocking code (ex: delay()) in the loop() function or this won't work right
}
Using the following code, I can't get the 3rd set of 5 numbers to display. I have changed the sevseg.h file to 15, but that shouldn't matter:
#include <SevSeg.h>
SevSeg sevseg1;//Instantiate a seven segment controller object 1
SevSeg sevseg2;//Instantiate a seven segment controller object 2
SevSeg sevseg3;//Instantiate a seven segment controller object 3
void setup()
{
Serial.begin(9600);
byte segmentPins[] = {22, 23, 24, 25, 26, 27, 28, 34}; //Segments: A,B,C,D,E,F,G,Period
byte digitPins1[] = {29, 30, 31, 32, 33};
sevseg1.begin(COMMON_CATHODE, sizeof(digitPins1), digitPins1, segmentPins);
sevseg1.setBrightness(10);
byte digitPins2[] = {35, 36, 37, 38, 39};
sevseg2.begin(COMMON_CATHODE, sizeof(digitPins2), digitPins2, segmentPins);
sevseg2.setBrightness(10);
byte digitPins3[] = {40, 41, 42, 43, 44};
sevseg3.begin(COMMON_CATHODE, sizeof(digitPins2), digitPins3, segmentPins);
sevseg3.setBrightness(10);
}
void loop()
{
static byte decPlace = 2;
sevseg1.setNumber( 12345, decPlace );
sevseg2.setNumber( 12345, decPlace );
sevseg3.setNumber( 12345, decPlace );
sevseg1.refreshDisplay();
sevseg2.refreshDisplay();
sevseg2.refreshDisplay();
}