Human Following Car
This thread was created to troubleshoot a human following car project.
5 Replies
@Harsh Thakur I created this thread for your question.
In your code (https://pastebin.com/qLAxZQWH), it seems that there is nothing included to handle a situation in which the ultrasonic sensor is > 30cm from the nearest object. What should the car be doing in this situation?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
In your code, there is no command for the car when the
distance
value is greater than 30. distance > 30
.
I suggest you add some debugging to your code with Serial.print()
and Serial.println()
, then connect the car to your computer with the USB cable while holding it in the air as you have in the video. You will be able to see what is happening in the code.
For example:
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
At the end of all of your if / else statements for the motors, you could add something like this also:
@Harsh Thakur
Please let me know if you have solved this problem, so I can mark this thread as "solved".