integrated nested loops so that the arduino prints the message a given number of times