Your counter was not counting.
Your counter was not counting.
I think we should pay them a visit.
Where are they?
Where did you get the idea to check if a button is enabled before responding to its click event?
Do you have buttons that respond to clicks, even after they are disabled, like zombies coming back to life?
Should MIT be sending a response team in hazmat suits to deal with your zombie buttons?
Or instead, should you be checking if your BlueTooth is connected before trying to send data on it?
Woops , I see what I did wrong there. I have changed this to:
The counter is now working perfectly indicating that the Clock is executing as it should.
Thank you @ABG
I found this program following this video here
hahaha sorry I am very new to App Inventor so I did not even think to question this, just assumed it is the way to do things
Okay now that you mention this, it makes more sense that the button checks are altered as you suggested:
No response team needed, zombie buttons have been neutralized
Thanks @ABG for your advice and help thus far. I still have a problem, the Connection status being checked by the clock periodically does not appear to be updating when I disconnect my Bluetooth device (when I switch off the ESP32 controller) or when I move out of range: the app does not change the connection status to "Disconnected". Maybe the way that the "IsConnected" function works does not detect a break in the connection if the Bluetooth device is switched OFF or out of range?
This sounds like a familiar complaint.
The second link looks like it will solve my problem. I will try it and provide feedback if I have any issues, Thanks a lot @ABG
I have amended the program as the solution in link 2 suggested:
The error message "Error 516: Unable to write: Broken pipe" is popping up on the screen when I switch off my controller but Label1 still does not update to disconnected and I can't seem to see why not. What am I missing
supongo que si le dices que se desconecte si hay un error nunca llegara a estar conectado
your blocks do not help to find out, if the connection is broken, because the Connected property will not change to "false"... this is how the bluetooth communication once was designed...
if you get this message, then you know, that the connection is broken
you can catch that message in the Screen.ErrorOccurred event
Ola @Fran914293 Perdona mi español porque estoy usando el traductor de Google. Se conecta. el problema es que no detecta cuando se desconecta el dispositivo.
ah, claro, nunca trabaje con bluetooth entonces no se
Hello Taifun, thanks for replying to my issue. My next step was to investigate if I could use the error to detect a disconnection. In fact I came across something similar in a few google searches. I will try this method and update this post thereafter. Before doing so though, I am a little confused as to why the solution suggested by ABG in a previous comment (this one) worked for them but did not work for me. When you say:
do you mean that this solution worked previously but for AI2 it does not or did I do something wrong when incorporating that solution into my program?
This is critical ...
no, it never worked for App Inventor nor for any other programming language because of the bluetooth design
@Taifun @ABG Thanks a lot for the assistance guys.
I am still pursuing the "catching the error" approach to prevent the standard ugly error message from popping up and rather use a customized notification instead.
see here https://puravidaapps.com/btchat.php
you might want to adjust it to your needs...
if errorNumber = 516 then do whatever you want
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.