I'm trying to create a timer with Arduino and 3 buttons. One of the buttons is to increase the time when it is pressed. I would like to know if it is possible on the OLED display to show "00:00" instead of "0". So for example, when I increase the value to 120, it shows "02:00" instead of "120"?
Suppose you have a variable count
, then this will show it as MM:SS
:
int min = count/60;
int sec = count%60;
sprintf(buf, "%02d:%02d", min, sec);
display.draw2x2String(2,3,buf);