Skip to content

Instantly share code, notes, and snippets.

@eydam-prototyping
Created February 16, 2021 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eydam-prototyping/319c5c83da88a52fdf285ded349d20e4 to your computer and use it in GitHub Desktop.
Save eydam-prototyping/319c5c83da88a52fdf285ded349d20e4 to your computer and use it in GitHub Desktop.
menu.py v1
import machine
import ep_lcd_menu
from rotary_irq_esp import RotaryIRQ
from esp8266_i2c_lcd import I2cLcd
def setup(temps, sm):
i2c = machine.I2C(0, scl=machine.Pin(22), sda=machine.Pin(21))
lcd = I2cLcd(i2c, 39, 2, 16)
lcd.clear()
r = RotaryIRQ(18, 19, 0, 10, False)
menu = ep_lcd_menu.menu_rot_enc(
menu_config_file="menu.json", display_type="1602", display=lcd, rotary=r, button_pin=5)
menu.load()
menu.render()
return menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment