Hello, I tried to setup an int variable that combines 2 int variables. I have to do this because I want to combine an hour and a minute variable. In my code I may have some extra lines for troubleshooting.
#include "Arduino.h"
#include "uRTCLib.h"
// uRTCLib rtc;
uRTCLib rtc(0x68);
int DateTime = rtc.hour() * 10 + rtc.minute();
int NowTime = rtc.hour()*100+rtc.minute();
void setup() {
Serial.begin(9600);
delay(3000); // wait for console opening
URTCLIB_WIRE.begin();
// Comment out below line once you set the date & time.
// Following line sets the RTC with an explicit date & time
// for example to set January 13 2022 at 12:56 you would call:
// rtc.set(second, minute, hour, dayOfWeek, dayOfMonth, month, year)
// set day of week (1=Sunday, 7=Saturday)
}
void loop() {
rtc.refresh();
Serial.print(rtc.hour());
Serial.print(':');
Serial.println(rtc.minute());
Serial.println(NowTime);
delay(1000);
}
However this is my serial output:
18:50
0
18:50
0
18:50
0
18:50
0
18:50
0
18:50
0
18:50
0
Does anyone know what to do?