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

    Button Error

    Scheduled Pinned Locked Moved UIFlow
    4 Posts 2 Posters 7.2k 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.
    • B Offline
      birdsong
      last edited by birdsong

      What do you think is causing the error "'M5TextBox' object has no attribute 'wasReleased'" to display on the screen when I download the program to a M5stack?

      0_1592723070789_Capture.PNG

      def buttonC_wasReleased():
        global bDecreaseSp, iMenu, bIncreaseSp, bTm250ms, thrd10ms, iBackLtTm20min, thrdDispStatBar, thrdDispPvSp, fPvHrs, bTm1s, thrdCtrlFan, thrd20ms, fPvTemp, bRunFan, bRunFanOld, bTm6min, thrd30ms, iTm250ms, bTm15min, iSpMode, iStatus, thrd40ms, fSpTemp, fSpRH, fSpMaxHrs, thrd50ms, thrd60ms, fPvRH, iTm1s, fSpHrs, iTm6min, iTm15min
        bDecreaseSp = True
        iBackLtTm20min = 4800
        pass
      btnC.wasReleased(buttonC_wasReleased)
      
      def buttonA_wasReleased():
        global bDecreaseSp, iMenu, bIncreaseSp, bTm250ms, thrd10ms, iBackLtTm20min, thrdDispStatBar, thrdDispPvSp, fPvHrs, bTm1s, thrdCtrlFan, thrd20ms, fPvTemp, bRunFan, bRunFanOld, bTm6min, thrd30ms, iTm250ms, bTm15min, iSpMode, iStatus, thrd40ms, fSpTemp, fSpRH, fSpMaxHrs, thrd50ms, thrd60ms, fPvRH, iTm1s, fSpHrs, iTm6min, iTm15min
        iMenu = (iMenu if isinstance(iMenu, Number) else 0) + 1
        iBackLtTm20min = 4800
        pass
      btnA.wasReleased(buttonA_wasReleased)
      
      def buttonB_wasReleased():
        global bDecreaseSp, iMenu, bIncreaseSp, bTm250ms, thrd10ms, iBackLtTm20min, thrdDispStatBar, thrdDispPvSp, fPvHrs, bTm1s, thrdCtrlFan, thrd20ms, fPvTemp, bRunFan, bRunFanOld, bTm6min, thrd30ms, iTm250ms, bTm15min, iSpMode, iStatus, thrd40ms, fSpTemp, fSpRH, fSpMaxHrs, thrd50ms, thrd60ms, fPvRH, iTm1s, fSpHrs, iTm6min, iTm15min
        bIncreaseSp = True
        iBackLtTm20min = 4800
        pass
      btnB.wasReleased(buttonB_wasReleased)
      
      1 Reply Last reply Reply Quote 0
      • B Offline
        birdsong
        last edited by birdsong

        @birdsong said in Button Error:
        Solution:
        I gave text a label btnA, when I changed it to labelA that bug was cleared.

        1 Reply Last reply Reply Quote 0
        • m5stackM Online
          m5stack
          last edited by

          could you provide the whole program. it will very helpful for us to find the problem.

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            birdsong @m5stack
            last edited by

            @m5stack Its ok thanks, problem solved. I gave the text label the name 'btnA' which is already a M5stack function, so renamingthe label cleared the problem.

            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