Before anything, I have searched up on the Internet and found that you need to connect Tx and Rx but that made no difference at all ![]()
I am making a obstacle avoiding robot without a servo but using 2 DC motors instead.
I have wired everything correctly as when I open the serial monitor, the correct sentences are displayed.
When I plug in the UNO to the board and upload the program, both motors drive forward but when I put my hand in front of it, it makes one motor go forward and one motor go backward.
However, when I disconnect and plug in my 9v battery, it waits a while and then starts spinning although there is no obstacle in front of it.
I am using a Arduino UNO and a Adafruit motor shield v1, the sensor that I am using is the HC SRO4
The motors are connected through motor 1 and motor 2 ports
The HC SR04 trigger and echo pins are connected through the servo ports on the shield which are connected at digital pins 9 and 10
This whole setup is working and accurate as the motors turn when there is a obstacle in between 1cm and 26cm
HERE IS THE CODE THAT I HAVE USED:
Before anything, I have searched up on the Internet and found that you need to connect Tx and Rx but that made no difference at all :(
I am making a obstacle avoiding robot without a servo but using 2 DC motors instead.
I have wired everything correctly as when I open the serial monitor, the correct sentences are displayed.
When I plug in the UNO to the board and upload the program, both motors drive forward but when I put my hand in front of it, it makes one motor go forward and one motor go backward.
However, when I disconnect and plug in my 9v battery, it waits a while and then starts spinning although there is no obstacle in front of it.
I am using a Arduino UNO and a Adafruit motor shield v1, the sensor that I am using is the HC SRO4
The motors are connected through motor 1 and motor 2 ports
The HC SR04 trigger and echo pins are connected through the servo ports on the shield which are connected at digital pins 9 and 10
This whole setup is working and accurate as the motors turn when there is a obstacle in between 1cm and 26cm
HERE IS THE CODE THAT I HAVE USED:
[code]Before anything, I have searched up on the Internet and found that you need to connect Tx and Rx but that made no difference at all :(
I am making a obstacle avoiding robot without a servo but using 2 DC motors instead.
I have wired everything correctly as when I open the serial monitor, the correct sentences are displayed.
When I plug in the UNO to the board and upload the program, both motors drive forward but when I put my hand in front of it, it makes one motor go forward and one motor go backward.
However, when I disconnect and plug in my 9v battery, it waits a while and then starts spinning although there is no obstacle in front of it.
I am using a Arduino UNO and a Adafruit motor shield v1, the sensor that I am using is the HC SRO4
The motors are connected through motor 1 and motor 2 ports
The HC SR04 trigger and echo pins are connected through the servo ports on the shield which are connected at digital pins 9 and 10
This whole setup is working and accurate as the motors turn when there is a obstacle in between 1cm and 26cm
ps :I have a 6v battery holder with AA batteries connected to the motor shield aswell as a 9v battery
HERE IS THE CODE THAT I HAVE USED:
I ALSO ADD A ATACHMENT
obstacle_avoiding_robot_1.ino (1.98 KB)