Experiment 2 Turning Right and Left

Share for us
Share on facebook
Share on twitter
Share on pinterest
Share on whatsapp

The principle and connection diagram for this experiment are the same as those for the first experiment. Only a turning function is added. After going forward for one second, the car turns right. After another second, the car turns left. One second later, it goes forward, and then backward. Two seconds later, it stops. Simply put, the car does: go forward for one second, turn right for one second, go forward for one second, and then turn left for one second, finally go forward and then backward, and stop two seconds later.

Components

– 1 * Car model

– 2 * 18650 battery

– 1 * USB cable

– Several Dupont wires

Experimental Principle

Change the rotational angle by sketch to make the car turn.

Experimental Procedures

After you have finished all the connections, connect the SunFounder Uno board to your computer. Download the sketch under the path Smart Car for Arduino\Code\2.Car_Turn \Car_Turn, and then remove the USB cable. Press down the button on the switch module, and the car will start running.

Experimental Phenomena

When you press down the button on the switch module, the car will go forward. 1 second later, it turns right, and then goes forward for 1 second again. Then it turns left. 1 second later, the car goes forward for 1 second and then goes backward. Two seconds later, it stops.

The routine: go forward for one second, then turn right for one second, go forward for one second, and then turn left for one second. Finally go backward. Two seconds later, stop.