How to show numbers on an OLED after pressing 2 pushbuttons with UG8 Library

Anyone can show me a simple sketch code on how I can use 2 pushbuttons to print numbers on an OLED. I bascially want button1 when pressed to show the number 1 on the OLED, and the number 1 will clear after 10 sec. if no buttons are pressed, but if in those 10 secs button1 or button2 is pressed it will restart the 10sec clock and so we have 11 or 12, since button2 press makes a 2 on the OLED to the right of the 1. So there are only 1 or 2 digits possible, it can't be 111 or 222, just 11 or 22 or 1 or 2.

I'm using this library: GitHub - olikraus/u8glib: Arduino Monochrom Graphics Library for LCDs and OLEDs

with it set to this: U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE); // I2C / TWI

I'm also using an arduino nano.

Do you know how to show number on the OLED, with no switches needing to be pressed?

Do you have switches wired? Do you know how to read them?

If you can answer yes to both questions, what you want to do is trivial. If you can't, work on those two things first. Then, ask for help.

PaulS:
Do you know how to show number on the OLED, with no switches needing to be pressed?

Do you have switches wired? Do you know how to read them?

If you can answer yes to both questions, what you want to do is trivial. If you can't, work on those two things first. Then, ask for help.

No, i don't know how to show the number on the OLED just on the serial monitor.

Yes switches are wired, but only see on serial monitor.

as Paul suggested, don't you think the first thing to figure out is how to display anything on the OLED display? is there any example code in the library?

gcjr:
as Paul suggested, don't you think the first thing to figure out is how to display anything on the OLED display? is there any example code in the library?

Yes, I know how to display Hello World text on the OLED, but this is without a button. I'm asking how to display numbers after a pushbutton press.

so when a button is pressed, display a numbers, "123", instead of "Hello World".

what are you really asking?

im asking how to limit the digits to two. so no number can be greater than 3 decimals.

modulo arithmetic

x = x % 1000;