Button Error



  • 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)
    


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


  • M5Stack

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



  • @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.