LennartHennigs / ESPRotary

Arduino/ESP library to simplify reading rotary encoder data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Llamado de funciones

CarlosFonseca97 opened this issue · comments

Hola, primeramente agradecerte por esta fantástica librería acopla perfectamente el buen uso y sentido del encoder rotativo.

Quisiera pedir de forma amable y si es posible como estructurarías con tu librería claramente un menú, no logro entender como realizas los llamados en el void loop para función en especifica para así realizar el menú.

El menú que tengo pensado hacer es relativamente simple de 5 filas. Donde 4 filas son para mostrar el valor en tiempo real de las variables.
Temperatura 55
Humedad 40
Luminosidad 20
Presión 10
Opciones PUSH
La ultima fila (opciones) al presionar con el encoder, me permite modificar los valores de SetPoint de las 4 variables respectivamente.

Agradezco tu atencion prestada y resalto tu excelente trabajo.

Hello, please stick to English for all questions and/or comments.
Otherwise I will close them, as I cannot understand Spanish.
Thank you.

ohh I'm sorry.

Hello, first of all thank you for this fantastic library perfectly matches the good use and sense of the rotary encoder.

I would like to ask in a friendly way and if it is possible how you would clearly structure a menu with your library, I cannot understand how you make the calls in the VOID LOOP for a specific function to make the menu.

The menu I plan to make is a relatively simple 5 row menu. Where 4 rows are to show the real-time value of the variables.
Temperature 55
Humidity 40
Brightness 20
Pressure 10
PUSH options
The last row (options) when pressing with the encoder, allows me to modify the SetPoint values ​​of the 4 variables respectively.

I appreciate your attention and highlight your excellent work.

Hello,
as this is not an issue or a bug I will close this!

But to your question on how to navigate a menu: the class allows you to define a function that is called on every turn of your encoder. In this functions you need to determine the now the active element of the menu. You need a library to detect the button click and then do something with it.

Don't mess with the loop() function in the main loop, as it keeps track of the encoder movements and triggers the function calls I described above.

Good luck.