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

    Button Error

    UIFlow
    2
    4
    5.8k
    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
      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
        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
          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
            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
            • First post
              Last post