il3ven
November 27, 2019, 2:01pm
1
Description
What MCU/Processor/Board and compiler are you using?
Nordics’s nRF52840
What do you want to achieve?
I have a monochrome OLED with 5 buttons (Up, Down, Left, Right, Enter).
I want to create a screen where I can enter text. Like the photo attached below.
What have you tried so far?
I tried to use a roller with Alphabets as options. I tried to stylize it but the final result is not very satisfying.
Does anyone have any suggestions how I can create an input screen like this ?
Screenshot and/or video
The most simple solution is
create a label with _ _ _ _ _ _ _
text
keep track of the current position in a variable
when up/down is pressed change the appropriate letter
Call lv_label_set_text()
to refresh the label
il3ven
November 29, 2019, 1:57pm
3
I have 5 buttons in my hardware. Like this.
I need the screen to be somewhat like this.
---------On pressing right------->
---------On pressing left------->
---------On pressing down------->
I think this type of navigation is not possible with label. I am trying to make it using buttons.
As of now I have two concerns. Will the buttons consume too much memory ? How can I make the buttons arrange themselves on screen ?
Is there something else you suggest ?
Thank You
You can create 4 labels to and use lv_label_set_body_draw(label, true);
it will draw a background with style.body
appearance.
With style.body.border.part = LV_BORDER_BOTTOM
you can display only a line in the bottom.
So it seems you can do it by
creating labels for each letter
2 styles (a full border, a bottom border)
changing the style of the labels and the text of the labels on button press
1 Like
il3ven
December 5, 2019, 5:12pm
5
Thank you for your reply. You are awesome.
I think this could actually work. I will share my work soon.
1 Like