I need help. When i call the function rtc.getUnixTime(rtc.getTime()); arduino stops my code so that the 7 segment display doesnt display anything.
#include <DS3231.h>
#include <SevSeg.h>
// Init the DS3231 using the hardware interface
DS3231 rtc(A5, A4);
Time t;
unsigned long currenttime;
unsigned long togethertime;
unsigned long sincetime;
SevSeg sevseg; //Instantiate a seven segment controller object
void setup()
{
Serial.begin(115200);
rtc.begin();
bool resistorsOnSegments = true;
bool updateWithDelaysIn = true;
byte hardwareConfig = COMMON_CATHODE;
byte numDigits = 4;
byte digitPins[] = {10, 11, 12, 13}; //Digits: 1,2,3,4
byte segmentPins[] = {9, 2, 3, 5, 6, 8, 7, 4}; //Segments: A,B,C,D,E,F,G,Period
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins);
sevseg.setBrightness(10);
}
void loop()
{
sevseg.setNumber(20, 0);
sevseg.refreshDisplay();
currenttime = rtc.getUnixTime(rtc.getTime());
}