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.
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?
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).
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.
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?