İ need help for lcd ui

I want to make a menu with Arduino Uno, 16x4 i2c LCD screen and 10k potentiometer. First, I divided the value coming from the potentiometer into a value between 0 and 7 using the map command. Then, for example, if the value is 3, the screen should be like this.
"
a 1st line
b 2nd line
c 3rd line
d< 4th line ("<" means selected)
(page 1)
"
If the value is 6, another page must be passed (since the screen has 4 lines).
it should be like this
"
e
f
g<
h
(page 2)
"

After that, when I press a button, whichever is selected, it should appear on the serial port.

Can you write an example code for this?

NOTE: please do not use 8 different "if" commands. I tried this in my own code and it takes up 25kb of space.

There's a section of the forum specifically for this type of request. Don't expect it to be free...

Perhaps post your code here so we can see what you are doing,

You should also state which Arduino you are using and what modules you are using as well as how you've connected the various bits together.

When I realized that this part of my code was taking up too much space, I spammed ctrl+z and deleted it. and I wrote all the parts I used in a descriptive manner in the first part of the article, and I could not find the appropriate category for it, where is it?

[Try here.](: Jobs and Paid Consultancy - Arduino Forum)

Convert your English specification into code, then post it so we can comment.

Where did 5 go?

There are seven groups of four characters...

0 = (space), a, b, c ("space" allows even groups)
1 = d, e, f, g
2 = h, i, j, k
3 = l, m, n, o
4 = p, q, r, s
5 = t, u, v w
6 = x, y, z, (space)

You will need to account for selecting a character or change character page when the cursor is at the top or bottom of a character page.

hello

yes something like that
by the way sorry i mean " if value is 6 "

hahah. "something"

You will need to keep track of the cursor row (0 through 3) and the alphabet page (0 through 6) to find the character under the cursor (row * LCD_LINES + page = character).

The code with "8 different if's" will take less than 1 Kb space. So it should be interesting to see on your 25kb code.

1 Like

I used 16.
hello

I said "something like that" there because only you understood what I meant. But it is no longer necessary, I found a simpler and more effective method. But thank you for your effort.

Perhaps you should show this?

There are many simpler, more efficient and effective ways to scroll a menu. You stated hardware and software parameters. Does your code adhere to your own parameters?

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