App Crashing When Try to control

Hi, im trying to make a bluetooth app to control an arduino car, but when y press some buttons in the app, it crashes and freezes.
Idk what's happening bc the car moves and so but a seconds later the app crashes, do somenone know what's happening?:frowning:


So you don't see any error messages? Chances are, a process invoked by one button is not completed before another button runs another process - if the commands to the car are all down the same pipeline, this could lead to an app crash and or Ardunio (Sketch) crash. We would need to see both Blocks and Sketch to help you more.

1 Like

How can i show you my arduino code and my app? can i send you photos or the code itself? im kind a new at this

Please export your project and post it here.

This also speeds up processing your problem:
Please download and post each of those event block(s)/procedures here ...
(sample video)

Your Arduino code can be uploaded (.ino file) or copied and pasted into your post.

1 Like

SN2.txt (3.4 KB)

There are the Blocks and the arduino code, thanks you for the help!

I notice you don't reset the state variable to '' after using it to control the motors each time through your loop().

Are those controls meant to be re-applied so many times in quick succession?

Also, is int the proper variable type for a single letter? (I am not sure.)

Also, where does that println() go? Are you trying to send to the app? I don't see any place in the AI2 code that handles incoming BlueTooth messages.

1 Like

Yeah i have some troubles in my code, still wip, but my app still crashing, thats my main problem now:( idk why it happends

Please export your project and post it here.

1 Like

Tanquesito.aia (3.6 KB)

Here it is

Try adding a Notifier for error messages, and that Screen1 Event block that catches errors to give you a place to launch the Notifier. Use the Notifier block that requires an OK button to dismiss the message, so you don't miss it.


it doesnt matter how i pass the app to the phone? im working on drive, should pass the app dirtectly to the phone?

The app says to me "The app stop working" wait or close