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?

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