EasyManua.ls Logo

SunFounder 3in1 Kit - Page 256

Default Icon
351 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SunFounder 3in1 Kit
Code
Note:
Open the 7.follow_your_hand.ino file under the path of 3in1-kit\car_project\7.follow_your_hand.
Or copy this code into Arduino IDE.
Or upload the code through the Arduino Web Editor.
Place the car on the ground after the code has been uploaded successfully. Place your hand close to 5*10cm in front
of the car, and it will follow your hand forward. If you put your hand close to the IR Obstacle module on both sides, it
will also turn to the corresponding direction.
How it works?
This project is a combination of the previous two projects 6. Play with Ultrasonic Module and 5. Play with Obstacle
Avoidance Module, but the implemented effect is different. The previous 2 projects are detecting an obstacle backwards,
but here it is detecting that your hand will follow the forward or turn direction. The workflow of this project is as follows.
Read the distance detected by the ultrasonic module and the value of both infrared modules.
If the distance is 5~10cm, let the car move with your hand.
If the left IR module detects your hand, turn left.
252 Chapter 5. Car Projects

Related product manuals