import ugfx, badge , appglue #, utime

badge.init()
ugfx.init()

def on_start(pressed):
    if pressed:
        appglue.home()

def show_main():
  ugfx.set_lut(ugfx.LUT_NORMAL)
  ugfx.clear(ugfx.WHITE)
  ugfx.flush()
  ugfx.string(0, 0, "Starting the plant controller", "Roboto_Regular12", ugfx.BLACK)
  

def program_main():
  ugfx.init()
  ugfx.set_lut(ugfx.LUT_NORMAL)
  ugfx.clear(ugfx.BLACK)
  ugfx.flush()
  
  ugfx.input_attach(ugfx.BTN_START, on_start)
  
  show_main()
  #appglue.start_app("") # Return home

# Start main application
while True:
  program_main()