menu with lcdOLED & encoder

hi every one im testing my lcd oled 128x32 and encoder cjmcu-111 with arduino pro micro im doing a menu like the picture but i cant control with encoder move on icons and select with encoder button it has 4 pins GA, GB, VCC, GND , and you can download code below, thanks
this is the menu



testmenu.ino (6.16 KB)

We like the sketch in your post between code-tags. The </> button is for the code-tags.

You could start from the beginning with this video: ROTARY ENCODER WITH INTERRUPTS - Arduino tutorial #12 - YouTube.

The best option for the encoder is the Encoder library: Encoder - Arduino Reference.

Or is the code the problem to select one of the three ?

i think the problem is code to select, i dont know what function change or instructions, anyway i will check the info you share with me, thanks for support

i think this function controls move selection cursor

void drawMenu(int start){

char tBuffer[22];

for(int i=0; i < NUM_MENU;i++){

if( (encoder0Pos) == i ){
display.setTextColor(BLACK, WHITE);
display.println(strcpy_P(tBuffer, (char*)pgm_read_word(&(menus[i+start]))));

//pintar mapas de bits en pantalla
display.drawBitmap(10, 1, cal, 30, 28, SSD1306_WHITE);
// display.invert(true);

display.drawBitmap(40, 1, vent, 29, 28, SSD1306_WHITE);

display.drawBitmap(70, 1, reloj, 29, 27, SSD1306_WHITE);


This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.