#include "SevSeg.h"
SevSeg sevseg;
#define MAX_NUMBER_STRINGS 12
#define MAX_STRING_SIZE 8
char testStrings[MAX_NUMBER_STRINGS][MAX_STRING_SIZE];
#define PATTERN_CHANGE_TIME 100
unsigned long timer = millis() - PATTERN_CHANGE_TIME;
byte testStringsPos = 0;
void setup() {
byte numDigits = 4;
byte digitPins[] = {2, 3, 4, 5};
byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13};
bool resistorsOnSegments = false;
byte hardwareConfig = COMMON_ANODE;
bool updateWithDelays = false;
bool leadingZeros = false;
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments, updateWithDelays, leadingZeros);
sevseg.setBrightness(90);
strcpy(testStrings[0], "CF89");
strcpy(testStrings[1], "CF89");
strcpy(testStrings[2], "CF89");
strcpy(testStrings[3], "CF89");
strcpy(testStrings[4], "CF89");
strcpy(testStrings[5], "CF89");
strcpy(testStrings[6], "CF89");
strcpy(testStrings[7], "CF89");
strcpy(testStrings[8], "CF89");
strcpy(testStrings[9], "CF89");
strcpy(testStrings[10], "CF89");
strcpy(testStrings[11], "CF89");
}
void loop() {
// Cycle to the next string every one second
if (millis() > (timer + PATTERN_CHANGE_TIME)) {
sevseg.setChars(testStrings[testStringsPos]);
testStringsPos++;
if (testStringsPos >= MAX_NUMBER_STRINGS) testStringsPos = 0;
timer = millis();
}
sevseg.refreshDisplay();
}