Hello there! I use Arduino Mega and L293D motor shield with bluetooth HC-05 ran by Blueduino Android Mobile App for control. Everything seems to be simple, but when I put the car on the floor it does not stop after start, though it stops when I test it on the table. Would you, please, tell what would be any reason of such a strange behaviour? I repeated this procedure many times, first tested - everything was fine, then put the car on the floor, - it just did not stop, so I had to stop it manually by swithing the power off. Here is the code that I use to run it:
The first thing I am going to do is to attach an LCD display to the car to see that commands such as "FORWARD, BACKWARD and RELEASE" come to the corresponding IF statement correctly, but any other ideas on what may be any possible reason for that malfunction would be much appreciated.
Let me check I understand. When on the table, the car responds to 's' by starting and then responds to 'b' by stopping. But when on the floor, the car responds to 's' by starting but then does not respond to 'b' and does not stop?
Does it respond to other commands?
If I am correct, this does not seem to be a code problem. The code will behave the same on the table as it does on the floor.
I guess you don't have your LCD display to try yet. But you could flash the built-in led when a command is received, to know if, when on the floor, the 'b' command is received.
Thank you all for your kind replies. I was going to use an LCD, but of course just to use a LED is much simpler to check the bluetooth response. I will do that and let you know. And thank you for your notice about quotes.
I added two LEDS to the electromobile (one for movement and one for stopping) and put the bluetooth higher over the bottom surface of the floor. Now it works as expected. I don't really know what the actual problem was. Maybe, the signal was too close to the ground because at the very start, when the bluetooth was too close to the floor the corresponding LED didn't light.
What you have to realise is Bluetooth is an other protocol using RF energy.
The antenna used will not perform well if an object is placed very close to it, always put your Bluetooth device so the antenna is clear of nearby objects.
Thank you, guys! For now it seems to be working fine. Here is the latest photo of the electromobile with the antenna attached and C++ code if anyone here is interested.