0

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"?

Share a link to this question (includes your user id)
| edit | | close | delete |
0

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);
Share a link to this answer (includes your user id)
| edit | delete |

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.