alanesq / BasicOLEDMenu

A very simple menu system using an oled and rotary encoder
GNU General Public License v3.0
49 stars 10 forks source link

Change value Slow or Fast #4

Open solrac3f opened 1 year ago

solrac3f commented 1 year ago

Hello, first of all, I would like to say that this Menu with Encoder is very good and thank you for sharing it. I am some kind of beginner in c++. That is why I come here to ask for help.

I think it would be nice to have the possibility to change the values in the Submenu depending on the speed that the encoder is turning.

What I mean is. If turning the encoder slow it would encrease or decrease the value by 1. If turning fast it would change the value by 10 for example.

I would make the following change in the code as follow.

" // demonstration enter a value void value1() {   resetMenu();                           menuMode = value;                       oledMenu.menuTitle = "demo_value";        oledMenu.mValueLow = 0;                  oledMenu.mValueHigh = 100;         If (slow_fast== 0) {        oledMenu.mValueStep = 1;             }     If (slow_fast== 1) {        oledMenu.mValueStep = 10;             }     oledMenu.mValueEntered = 50;            } " Only I don't know, where and how I could change inside the code the variable slow_fast from state 1 or 0.

I would appreciate your point of view and thanks in advance for some help.