ENA = 5, IN1 = 7, IN2 = 8, and forward(), backward() and stopMotor() are as in the lesson.
Check that you can control direction and speed with a motor driver.
Each sketch includes the Servo library and attaches s to pin 9 in setup().
The motor is driven by an NPN transistor on pin 9 with a flyback diode and a common ground.
Check that you know how to switch a motor safely with a transistor.
Assume the IR module is active-low (OUT = LOW when it detects something) unless stated.
Check that you understand how IR sensors work and how to read them.
Use cm = duration × 0.034 ÷ 2 and predict what each sketch does.
Check that you understand how the HC-SR04 measures distance.
