#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 780
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], ".-..--.");
strcpy(testStrings[1], ".H.I.");
strcpy(testStrings[2], ". ");
strcpy(testStrings[3], ".I ");
strcpy(testStrings[4], ".I.S");
strcpy(testStrings[5], "I.S..");
strcpy(testStrings[6], "B.O.B.I");
strcpy(testStrings[7], "B.I.L.O");
strcpy(testStrings[8], ". . . .");
strcpy(testStrings[9], " r.U.S"); //Here is my name on 32-33 rows.
strcpy(testStrings[10], "L.A.n..");
}
void loop() {
if (millis() > (timer + PATTERN_CHANGE_TIME)) {
sevSeg.setChars(testStrings[testStringsPos]);
testStringsPos++;
if (testStringsPos >= MAX_NUMBER_STRINGS)
{
testStringsPos = 0;
}
timer = millis();
}
sevSeg.refreshDisplay();
}