Arduino Bluetooth RC Car stop while button released.

I just built an RC car with an arduino, a bluetooth HC-05 Module and a L298 motor controller. I can control it via Bluetooth but the issue occurs when i release a button. Since the arduino receives commands via serial from the module, It continues to drive when I release the button from the app as the value is still in the Serial. I’m using the arduino bluetooth controller app on android. Here’s my code.

car.ino (546 Bytes)

Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :slight_smile:

You should send one message to the Arduino when the button is pressed and a different message when the button is released.