Lesson 26/31: Smart Car Part 4 : Avoiding Obstacle Using Ultrasonic Sensor | SunFounder Robojax
In this lesson, the fourth in our Smart Car series, we will integrate and utilize an Ultrasonic Sensor in our project. This sensor will enable our smart car to measure distances to objects. We will program the car's behavior based on these measurements: if the detected distance is greater than 25cm, the car will move forward; if it's between 2cm and 10cm, the car will move backward; and if the distance is less than 25cm, the car will come to a stop. We will identify and explain two common errors encountered in the code for this application. Furthermore, the wiring connections and the complete code will be thoroughly explained. Finally, the fully functional project will be demonstrated, showcasing the smart car's ability to react to varying distances.
This code has not been parsed yet. Please return to the admin panel to parse it.
Common Course Links
Common Course Files
Things you might need
-
AmazonSunFounder Arduino Learning kit on AliExpresss.click.aliexpress.com
-
Amazon
-
Amazon
-
Amazon
-
Amazon
Resources & references
-
DocumentationDocumentation for SunFounder 3 in 1 IoT/Smart Car/Learning Kit¶docs.sunfounder.com
-
ExternalPurchase SunFounder's 3-in-1 Smart car learning kitsunfounder.com
Files📁
Arduino Libraries (zip)
-
SunFounder's 3-in-1 Smart Car learning kit source code
3in1-kit-main-v2.zip12.80 MB