My app works buth crashes after a while

Hi Kas,
You could have pasted the text instead of a picture, that would have been easier to read.
I see some potential problems:
You do some print() and println(). These are certainly return messages that could clog the buffers.
So make some blocks in App Inventor to read the return messages. Look here for a hint on how to do that:

Also, you are sending the messages every 10 milliseconds. That is way to often!
You should find a reasonable value, 1000 or 500 should be fine.
Just some things to try.