Stopwatch using a 32 x 8 LED Matrix

Hi Steve,

I can't see your LED matrix. So from this discription i'm unsure what you see on the LED-Matrix.
Just post what you expect to see as digits
and post what you is shown by the LED-matrix.

If you replace the itoa-functions by different fixed strings what do you see then?

It might be that each p.print starts printing new at the left most digit.
Just for debugging purposes to find out about this
the function delay() could be used (one of the rare cases where delay() is handy to use)

If you insert a delay(2000);
after each p.print this does what the name says
delay program-execution for 2000 milliseconds. which in this case means
show LED-matrix for two seconds after each print instead run through all p.prints

If this is the case the solution is to concenate all numbers into one string and do only one p.print

Me personal I prefer using the SafeString-library because it makes handling with strings easier. You smple assign bytes, integers, longs and even float-variables to the safestring by writing "=" or concenating them by "+="

here is a demo-code how safestrings can be used.
The demo includes some useful functions

#include <SafeString.h>
createSafeString(myDemo_SS, 32);
createSafeString(mySecondDemo_SS, 32);

unsigned long myCounter;

// if program starts printout the source-code filename etc. to the serial monitor
void PrintFileNameDateTime() {
  Serial.println( F("Code running comes from file ") );
  Serial.println(__FILE__);
  Serial.print( F("  compiled ") );
  Serial.print(__DATE__);
  Serial.print( F(" ") );
  Serial.println(__TIME__);  
}

//useful function for non-blocking timing
boolean TimePeriodIsOver (unsigned long &periodStartTime, unsigned long TimePeriod) {
  unsigned long currentMillis  = millis();  
  if ( currentMillis - periodStartTime >= TimePeriod )
  {
    periodStartTime = currentMillis; // set new expireTime
    return true;                // more time than TimePeriod) has elapsed since last time if-condition was true
  } 
  else return false;            // not expired
}

unsigned long MyTestTimer = 0;                   // variables MUST be of type unsigned long
const byte    OnBoard_LED = 13; // Arduino-Uno Onboard-LED is IO-pin 13

// make onboard-LED blink to show: "program is running"
void BlinkHeartBeatLED(int IO_Pin, int BlinkPeriod) {
  static unsigned long MyBlinkTimer;
  pinMode(IO_Pin, OUTPUT);
  
  if ( TimePeriodIsOver(MyBlinkTimer,BlinkPeriod) ) {
    digitalWrite(IO_Pin,!digitalRead(IO_Pin) ); 
  }
}



void setup() {
  Serial.begin(115200);
  Serial.println( F("Setup-Start") );
  PrintFileNameDateTime();
  myCounter = 0;
  myDemo_SS = "Hello world!";
}


void loop() {
  BlinkHeartBeatLED(OnBoard_LED,500);
  myCounter++;
  
  // loop is running very fast counting up very fast
  // but only once every 1234 milliseconds print 
  if ( TimePeriodIsOver(MyTestTimer,1234) ) {
    mySecondDemo_SS = myDemo_SS;  // assigning a SafeString to another SafeString
    
    mySecondDemo_SS += " ";       // append a SPACE
    mySecondDemo_SS += myCounter; // append integer-number
    Serial.println(mySecondDemo_SS);    
  }  

}

you can install the SafeString-library through the library-manager of the Arduino-IDE
best regards Stefan