Hey Guys,
Thanks for having a look at my post.
I'm fairly new to Arduino and am very average at coding – so please forgive me if my code is horrendously structured or way longer than it needs to be! A Uni assignment has required me to delve into this field and give it a crack!
I’ve had a fair bit of success using YouTube, sample code and referring to other questions posted on the Arduino Forums to get me this far, however can’t seem to solve this particular problem.
I’ve developed a case statement which I want to use to automatically cycle through three different screens/displays – a stopwatch, a clock and a counter. When I open the serial monitor it communicates that the case is switch every 10 seconds between the three screens. But on the actual, physical matrix display it only shows the stopwatch with a flash of what I want to be displayed next only appearing for less than a second.
//Case statements for switching between Counter, Stopwatch and Clock
if(stopWatchSecs % switchInterval == 0 && !matrixSwitched){
matrixSwitched = true;
Serial.println("Switched");
matrixSwitch++;
if(matrixSwitch == 3)
matrixSwitch = 0;
switch(matrixSwitch){
case 0:
Serial.println("Case 0");
matrixFormat();
break;
case 1:
Serial.println("Case 1");
timeClockCode();
break;
case 2:
Serial.println("Case 2");
lapCounterCode();
break;
}
}
if(stopWatchSecs % switchInterval == 1 && matrixSwitched){
matrixSwitched = false;
}
}
Oh and I’m currently trying to merge all my different functions together (the clock, stopwatch and counter) so all of that individual code won’t be in the file.
Would love your help and feedback! I’ve attached the code below.
THart_SwitchMatrixIssue.ino (4.91 KB)