How to display two digits on an OLED from two presses on a keypad? I believe it works differently than an LCD. I'm using the u8g library. See video: Arduino - YouTube
why isn't is obvious that you need to post the code that you are using?
void dispOled(
const char *s0,
const char *s1,
const char *s2,
const char *s3,
bool clr )
{
if (clr)
display.clear();
display.setTextAlignment(TEXT_ALIGN_LEFT);
if (s0) {
display.drawString(0, DISP_Y0, s0);
}
if (s1) {
display.drawString(0, DISP_Y1, s1);
}
if (s2) {
display.drawString(0, DISP_Y2, s2);
}
if (s3) {
display.drawString(0, DISP_Y3, s3);
}
display.display();
}
// display menu
static MenuStim_t
dispMenu (void)
{
timeSec = msec / 1000;
if (! loco) {
sprintf (s, "%2d:%02d No Loco", timeSec / 60, timeSec % 60);
}
else {
sprintf (s, "%2d:%02d Loco %d", timeSec / 60, timeSec % 60, loco);
}
dispOled (s, 0, 0, 0, CLR);
return updtMenu ();
}
#include "SSD1306Wire.h"
// init OLED display
display.init();
display.flipScreenVertically();
display.setFont(ArialMT_Plain_16);
display.clear();
display.setTextAlignment(TEXT_ALIGN_LEFT);
display.setColor(WHITE);