Two motors: a robot car
One L298N, two channels (A = left, B = right); same direction = straight, opposite = spin; every move = IN1–IN4 HIGH/LOW.
Two motors. One robot car! 🚗🤖
1️⃣ ONE DRIVER, TWO CHANNELS: an L298N has two H-bridges. Channel A (OUT1 + OUT2) drives the left motor, channel B (OUT3 + OUT4) drives the right motor. IN1–IN4 come from the Arduino.
2️⃣ MIX THE WHEELS: both wheels forward → it drives straight. Left wheel back + right wheel forward → it spins left. The opposite → it spins right. No steering wheel needed!
3️⃣ 4 PINS = 1 MOVE:
forward(): IN1 HIGH, IN2 LOW, IN3 HIGH, IN4 LOW
spinLeft(): IN1 LOW, IN2 HIGH, IN3 HIGH, IN4 LOW
Tip: if one wheel turns the wrong way, swap its two motor wires.
📌 Steer by mixing two wheels.
Read the voiceover (transcript)
- Two motors. One robot car!
- One driver, two channels: A drives the left wheel, B the right.
- Both forward? It drives straight. Left back, right forward? It spins left!
- In code, every move is just four pins, IN one to IN four, high or low.
- Steer by mixing two wheels!
- Next: the stepper motor! Follow for part five!
Related lessons
Get new lessons + early access to the full course
One email when new lessons drop. No spam, unsubscribe any time.
✓ You're on the list. Check your inbox to confirm.
By joining you agree to the privacy policy.




