Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Menu (Buttons & Rotary Input) #498

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

chris-dot-exe
Copy link

@chris-dot-exe chris-dot-exe commented Apr 18, 2024

I started to make the menu from @FabianSperrle working again and since I wasn't really happy with the used menu library I got carried away and worked on a new one. (It's currently only used with clevercoffee - will make it more flexible in the future)

The menu is capable to set (most) parameters without using the website.

If used with buttons as input the buttons use the same pins as 'reserved' for the rotary encoder, so the menu is controlled with three buttons (up, down, enter)

Depending on the activated features, more or less options are visible.
For example, Brew Time & Weight, Preinfusion and the Maintenance Item (currently only contains Backflush) are only visible if BREWCONTROL_TYPE > 0 etc.

The menu uses https://github.com/craftmetrics/esp32-button for button press detection and debouncing.

Activate

To enable the Menu, set FEATURE_MENU to 1 in the userConfig.h
MENU_INPUT supports MENUINPUT::BUTTONS and MENUINPUT::ROTARY

Menu Structure

Available Menu Items are at the moment:

  • Brew Temp.
  • Steam Temp.
  • PID (Toggle on/off)
  • Brew Time & Weight
    • Brew by Time
    • Brew by Weight
  • Preinfusion
    • Preinfusion Pause
    • Preinfusion (Time)
  • Maintenance
    • Backflush (Toggle on/off)
  • Advanced
    • Brew Temp. Offset
    • Standby
      • Standby (Toggle on/off)
      • Standby Time
    • PID Settings
      • Enable PonM (Toggle on/off)
      • Start Kp
      • Start Tn
      • Kp
      • Tn
      • Tv
      • Integrator Max
      • Steam Kp
      • Brew PID
        • Enable Brew PID (Toggle on/off)
        • BD Kp
        • BD Tn
        • BD Tv
        • PID BD Time
        • PID BD Sensitivity

Menu Control

  • The last item is always Back or Close Menu
  • Toggle Items have a 'radio button' icon at the end which is toggled like a radio button ;)
  • Input Items have a setable Value which is displayed as a float or integer and can be increased/decreased with the up/down buttons, saved (to the eeprom) with a short click on the enter button or aborted with a long hold of the enter button.
    • (Long Hold) of up/down increase the speed
    • Values are only setable within the limits which are already defined for the website.
  • every enter event in the menu also resets the standby timer
  • if the machine is in standby, the enter button can wake it up

Since I don't have a 'full expansion' yet, I couldn't test everything...
So, let me know what you guys think... (I'm also in the Discord under the name Kuraiko)

PS: It most certainly won't work with the vertical display

PXL_20240418_214340018 MP~2
PXL_20240418_214410127 MP~2
PXL_20240418_214428274 MP~2

@fiendie
Copy link
Member

fiendie commented Apr 19, 2024

While I actually prefer MonoMenu to LCDMenuLib2 the rotary encoder should work before we think about merging this.
But please don't duplicate entries in pinmapping.h or edit anything there at all really :)

Anyway, looks very promising!

@chris-dot-exe
Copy link
Author

@fiendie duplication in the pinmapping.h wasn't intended, maybe I forgot to remove the other ones or it happened when I merged the latest changes from the master. But the renaming was, since it's with this menu no longer restricted to a rotary encoder I thought calling the pins PIN_ROTARY_XXX is a bit misleading.

Okay, I'll try to add the encoder too ;)

@chris-dot-exe chris-dot-exe changed the title Display Menu Display Menu (Buttons & Rotary Input) Apr 19, 2024
@chris-dot-exe
Copy link
Author

Now also with (basic) support for the rotary encoder.

@LoQue90
Copy link
Member

LoQue90 commented Aug 18, 2024

just wanted to rebase your PR to current master, so i could give it a try on my mashine.
But there where some timer changes in the mean time, which someone more skilled than me have to fix, sorry for that :(

@@ -1644,6 +1646,10 @@ void setup() {
u8g2_prepare();
displayLogo(String("Version "), String(sysVersion));
delay(2000); // caused crash with wifi manager on esp8266, should be ok on esp32

#if FEATURE_MENU == 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you could be more specific with the naming:
-> FEATURE_DISPLAY_MENU
-> displayMenuHandler

@chris-dot-exe
Copy link
Author

just wanted to rebase your PR to current master, so i could give it a try on my mashine. But there where some timer changes in the mean time, which someone more skilled than me have to fix, sorry for that :(

Oh... sorry, hadn't looked into this stuff for a while. Life came up with some other 'distractions'...

I'll check the latest (timer) changes and the status of my lib if everything works with the rotary encoder now (can't remember ^^') and then get back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants