feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Add Pages support to ST7920 display

Open Wummeke opened this issue 2 years ago • 1 comments

Describe the problem you have/What new integration you would like

I salvaged a displayunit from an Ender3, it contains a rotary encoder and a ST7920 display. The display works fine in "Lamda-mode" but I would like to use pages, to I can scroll t hrough pages with the rotary encoder. Although the documentation says it does supports pages, the display remains blank after uploading a sketch with pages.

Please describe your use case for this integration and alternatives you've tried:

This works fine:

display:
  - platform: st7920
    id: the_display
    cs_pin:
      number: 19
      inverted: true
    width: 128
    height: 64
    update_interval: 10s
    lambda: |-
      it.print(1, 32, id(lucon20), "This is LAMBDA!!!11");

But I'd like this to work too:

display:
  - platform: st7920
    id: the_display
    cs_pin:
      number: 19
      inverted: true
    width: 128
    height: 64
    update_interval: 10s
    pages:
      - id: page1
        lambda: |-
          it.print(1, 32, id(lucon20), "This is page 1!");
      - id: page2
        lambda: |-
          it.print(1, 32, id(lucon20), "This is page 2!");

Additional context

Wummeke avatar Aug 07 '22 10:08 Wummeke

See this, as a workaround: https://github.com/esphome/feature-requests/issues/1480#issuecomment-1175133578

nagyrobi avatar Aug 07 '22 12:08 nagyrobi

See docs: https://esphome.io/components/display/st7920.html?highlight=pages Alternatively: https://esphome.io/cookbook/lambda_magic.html#display-pages-alternative

nagyrobi avatar Apr 12 '23 11:04 nagyrobi