Hello! This is my second post on this forum, so I wanted to thank you for the help for the previous problem. This time I'm creating a bluetooth car with hc-05 model and a motor shield l293D. I think that my code is fine because functions are working when I type through the serial monitor. However, it's not working with a bluetooth. HC-05 is successfully conected but when I send the commands, nothing happens. I tried HC-05 with a LED and it was working, but with motors it doesn't work. I also tried diffrent apps, but it's the same. Does anyone knows what could be wrong? Here's the code:
Everything you note would lead me question the power.
How is everything powered?
Can you provide a hand drawn schematic of how everything is connected?
Is that a small rectangular 9V smoke alarm battery (PP3)? That battery is totally unsuited for powering motors. It does not have the current capacity. Coupled with the 2 to 4 volt drop from the L293 it is no wonder that the motors do not work right.
I would not use the main serial port (Serial) to communicate with the HC05. I would use a spare hardware port, if available, or a software serial port and save the Serial port for program upload, monitoring program flow and variable values and debugging.
Yes it is (PP3). So, battery can be the problem? It was working well before connecting with the bluetooth (with serial monitor and just motors going forward or backward). Okay then, which power supply do you suggest insted of this PP3?