انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents
Robo Maker: home
0. Lab tour1
1. The start: the Arduino6
2. Wiring and the traffic light4
3. Inputs: the button4
4. Sound and movement5
5. Sensors and numbers5
6. Distance, the screen and colours5
7. Motors and the car4
8. The project: the city's smart gate3
9. From blocks to C++ code5
10. Sensors and screens in code5
11. Smart systems5
12. Bluetooth: control from the phone1

The motor and the L298N

Section 7: Motors and the carLesson 7.1 · ⏱ 8 min

The Arduino can't run a big motor on its own, so we use the L298N board, which takes orders from the Arduino and gives the two motors the battery's power.

🧩 Forward for a second, then stop
Blocks: setup — runs once
📌 Note
Speed from 0 to 255: 100 is slow, and 255 is the fastest.

📌 Another example: faster

Speed 255 (top speed) instead of 200.

🧩 Faster
Blocks: loop — repeats forever
Top speed
Top speed
✍️ Practise
Watch the motor's speed.
✍️ Practise here in the lessonor open the lab in a new page ↗
✍️ Practise
The car goes forward, then back.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

The car goes backward.

👀 Show the solution
🧩 Solution
Blocks: loop — repeats forever
In the lab
In the lab

Result: it goes backward.

Medium

A slow speed: 100.

👀 Show the solution
🧩 Solution
Blocks: loop — repeats forever
In the lab
In the lab

Result: it moves slowly.

Hard

It moves for two seconds, then stops.

👀 Show the solution
🧩 Solution
Blocks: setup — runs once
In the lab
In the lab

Result: it stops after two seconds.

Finished the lesson? Mark it so your progress counts.