Texts: Write a code for the Arduino UNO to meet the following requirements for the circuit above:
When the car is at rest, wait for a button press to determine forward or backward motion. The motor is off, and all LEDs are off.
If the forward button is pressed while the car is stationary, the motor turns in a clockwise direction, and the green LED is on.
If the car is in forward motion and the forward button is pressed, the motor accelerates. The motor can decelerate to 60rpm using the brake button. The green LED is on once the car is in forward motion.
If the reverse button is pressed while the car is stationary, the motor turns in an anti-clockwise direction, and the white LED indicator flashes continuously at a frequency of 2Hz.
When in forward/backward motion, if the brake button is pressed, the motor stops spinning. The green/white LEDs turn off, and the red LED turns on. If the brake button is pressed while the car is stationary, the red LED turns on (no change in DC motor).
U1 (VSS)
18
U1
IN1 VSS VS OUT1 IN2 OUT2 EN1
SIM1
10 EN2 15 IN3 IN4
GND
OUT3 OUT4
11
L293D <TEXT>
D1 LED-WHITE <TEXT>
R2
R3
220
220
D3 LED-GREEN <TEXT>
220
SIMULINO UNO <TEXT>
R1
D2 LED-RED <TEXT>
Forward button
Reverse button
Stop button
<TEXT>
<TEXT>TEXT>