Just a quick question of if there is a limit to how long the Arduino will send information to my computer. I a set of code that updated with a delay(1000); and would Serial.println(Sec); but after about 12 hours it stopped and I was wondering what my issue was any help will be greatly appreciated! Apparently new users cannot upload attachments so here's a CP of my sketch and there may be a bug with the last if statement but I couldn't tell from my troubleshooting.
Eventually it will be a clock read in binary via LEDs using a cascading clock.
int AMPM;
int Sec;
int Min1;
int Min2;
int Hour1;
int Hour2;
void setup() {
// put your setup code here, to run once:
Sec = 0;
Min1 = 0;
Min2 = 0;
Hour1 = 0;
Hour2 = 0;
Serial.begin(9600);
}
void loop() {
//initialize serial communication at 9600 bits per second:
delay(1000);
Sec = ( Sec + 1);
// print //out the state of the button:
if (Sec == 60) {
Min1 = (Min1 + 1);
Sec = 0;
}
if (Min1 == 10) {
Min2 = (Min2 + 1);
Min1 = 0;
}
if (Min2 == 6) {
Hour1 = (Hour1 + 1);
Min2 = 0;
}
if (Hour1 == 10) {
Hour2 = (Hour2 + 1) ;
Hour1 = 0;
}
if (Hour2 == 2) {
Hour1 = 1;
Hour2 = 0;
}
Serial.println(Sec);
Serial.println(Min1);
Serial.println(Min2);
Serial.println(Hour1);
Serial.println(Hour2);
