🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    FATAL ERROR: Name m5line is not defined

    Scheduled Pinned Locked Moved Bug Report
    1 Posts 1 Posters 4.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sysdl132S Offline
      sysdl132
      last edited by

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import unit
      
      setScreenColor(0x514f4f)
      earth0 = unit.get(unit.EARTH, unit.PORTA)
      
      std = M5Circle(40, 91, 10, 0xFFFFFF, 0xFFFFFF)
      text0 = M5TextBox(61, 119, "Status", lcd.FONT_Default, 0x78ff00, rotate=180)
      text1 = M5TextBox(77, 149, "Water monitor", lcd.FONT_DefaultSmall, 0x00e5ff, rotate=0)
      label0 = M5TextBox(77, 58, "value:", lcd.FONT_Default, 0xe4ff00, rotate=180)
      rectangle0 = M5Rect(2, 41, 34, 20, 0xFFFFFF, 0xFFFFFF)
      angread = M5TextBox(30, 57, "err", lcd.FONT_DefaultSmall, 0x000000, rotate=180)
      rectangle1 = M5Rect(16, 11, 20, 20, 0xFFFFFF, 0xFFFFFF)
      label1 = M5TextBox(77, 27, "Unit std:", lcd.FONT_DefaultSmall, 0xfffe00, rotate=180)
      line0 = M5Line(M5Line.PLINE, 16, 128, 62, 128, 0xFFFFFF)    # <--bug line
      need = M5TextBox(75, 74, "Water needed!", lcd.FONT_DefaultSmall, 0xff0000, rotate=180)
      
      # sysinit
      def init():
        need.hide()
        angread.setText('0')
        rectangle0.setBgColor(0xff0000)
        rectangle0.setBorderColor(0xff0000)
        std.setBgColor(0xff0000)
        std.setBorderColor(0xff0000)
      
      
      
      init()
      while True:
        if False:
          angread.setText(str(earth0.analogValue))
        elif False:
          pass
        wait_ms(2)
      

      Baudrate for M5 core/Stick/camera:115200/921600
      For M5StickC:115200/230400/750000/1500000
      For M5StickV:115200/921600/1500000
      For Atom:115200/230400/921600

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post