Robotika ● שיעור 1Lesson 1
→ חזרה← Back
קורס ארדואינו · מפגש 1Arduino course · Session 1

רובוטיקה וארדואינו
מאפס לאור שאתם מדליקים בקוד
Robotics & Arduino
from zero to a light you switch on with code

אין צורך בשום ניסיון קודם. עד סוף השיעור כל אחד כאן יכתוב תוכנה קטנה, יחבר כמה חוטים — ויגרום לנורה אמיתית להבהב. זה נשמע קסם; זה פשוט חשמל והיגיון. No prior experience needed. By the end of the lesson every one of you will write a little program, connect a few wires — and make a real light blink. It feels like magic; it's just electricity and logic.

🤖 מה זה רובוט, באמתWhat a robot really is
🧠 מה זה ארדואינוWhat an Arduino is
💡 מדליקים נורה — בידייםLight an LED — hands on

ניווט: חצים ← → במקלדת, או הכפתורים למטה · לחצו EN למונחים באנגלית Navigate: ← → arrow keys, or the buttons below · press עב for Hebrew

2מה נעשה היוםWhat we'll do today

שלוש שאלותThree questions

  • מה זה רובוטיקה ב-2026 — ולמה המכונת כביסה שלכם כמעט רובוטWhat robotics is in 2026 — and why your washing machine is almost a robot
  • מה זה ארדואינו — ולמה הוא לא מחשב, ולא פטל (Raspberry Pi)What an Arduino is — and why it's not a PC, and not a Raspberry Pi
  • איך גורמים לחומרה לזוז — כותבים קוד, מחברים חוט, מדליקים אורHow to make hardware move — write code, connect a wire, light it up

התרגיל — בשלביםThe build — in levels

  • שלב 0: להדליק נורה בלי שום קוד — רק חשמלLevel 0: light an LED with no code — just electricity
  • שלב 1: התוכנה הראשונה שלכם — Blink על הנורה שבלוחLevel 1: your first program — Blink on the onboard LED
  • שלב 2: נורה משלכם — ישר על הארדואינו, בלי לוח ובלי שילדLevel 2: your own LED — straight onto the Arduino, no breadboard, no shield
  • ריצת מסלול: כפתור, רמזור, נורה "נושמת" — כמה שנספיקRunway: a button, a traffic light, a "breathing" LED — as far as we get
אם לא נספיק הכול — מצוין. הכול כאן בשקופיות, ותוכלו להמשיך בבית.If we don't finish it all — great. It's all here in the slides, and you can continue at home.

3רגע — מה זה בכלל רובוט?Wait — what even is a robot?

שכחו לרגע מסרטים. רובוט הוא כל דבר שעושה שלושה דברים: חש את העולם, מחליט מה לעשות, ופועל עליו. זהו. בלי זרועות מתכת ובלי עיניים אדומות. Forget the movies for a second. A robot is anything that does three things: it senses the world, decides what to do, and acts on it. That's it. No metal arms or red eyes required.

לחצו על דבר — ונראה אם הוא עובר את המבחן:Tap a thing — and let's see if it passes the test:

👁️חש (קלט)Sense
🧠חושבThink
⚙️פועל (פלט)Act
בחרו דבר מהרשימה…Pick a thing from the list…
הקו המטושטש: טוסטר רק מריץ טיימר (פועל, אבל לא "חושב" על כלום). שואב-רובוט חש קיר, מחליט לפנות, ונוסע — לולאה מלאה. זה ההבדל.The blurry line: a toaster just runs a timer (it acts, but doesn't "decide" anything). A robot vacuum senses a wall, decides to turn, and drives — a full loop. That's the difference.

4הקורס כולו בתמונה אחתThe whole course in one picture

הלולאה הזאת — חש ← חושב ← פועל ← חש… — חוזרת על עצמה אלפי פעמים בשנייה, לנצח, כל עוד יש חשמל. כל רובוט שנבנה בקורס הוא בסך הכול גרסה של הלולאה הזו. This loop — sense → think → act → sense… — repeats thousands of times a second, forever, as long as there's power. Every robot we build in this course is just a version of this loop.

  • חש = חיישנים: מרחק, אור, כפתור, חום, קולSense = sensors: distance, light, a button, heat, sound
  • חושב = הקוד שלכם: if / else, חישוב, החלטהThink = your code: if / else, a calculation, a decision
  • פועל = "שרירים": נורה, מנוע, רמקול, מסךAct = "muscles": an LED, a motor, a buzzer, a screen
היום הלולאה שלנו קטנטנה: הקוד "חושב" להדליק, ופועל על נורה. בשיעורים הבאים נוסיף חישה ומנועים.Today our loop is tiny: the code "thinks" turn on, and acts on an LED. In later lessons we add sensing and motors.

5תכירו: הארדואינוMeet the Arduino

ארדואינו הוא מחשב זעיר וזול על לוח אחד, שתוכנן כדי שתוכלו לחבר אליו חוטים ולשלוט בעולם האמיתי. עולה בערך כמו שתי כוסות קפה, ושורד גם אם תחברו משהו הפוך (בדרך כלל). An Arduino is a tiny, cheap computer on a single board, designed so you can wire things to it and control the real world. It costs about two cups of coffee, and survives most wiring mistakes (usually).

לחצו על חלקי הלוח כדי להכיר אותם:Tap the parts of the board to get to know them:

← לחצו על חלק בלוחTap a part of the board →
ATmega328 DIGITAL (0~13) ANALOG IN 5V · GND LED 13

(לוח לדוגמה: Arduino Uno — הנפוץ ביותר ללימוד)(Example board: Arduino Uno — the most common for learning)

6למה זה שינה הכולWhy it changed everything

לפני ארדואינו (לפני ~2005)Before Arduino (pre ~2005)

  • שבבי בקרה היו קיימים — אבל יקרים ומפחידיםControl chips existed — but were expensive and intimidating
  • היה צריך "מתכנת" חומרה נפרד ויקר כדי להעלות קודYou needed a separate, pricey hardware "programmer" to upload code
  • כלים מסובכים, בשפה נמוכה, בלי קהילה שתעזורComplex, low-level tools, and no community to help
  • להבהב נורה היה פרויקט לסוף שבועBlinking an LED was a weekend project

מה ארדואינו עשהWhat Arduino did

  • 💵 זול — עשרות שקלים במקום מאות💵 Cheap — tens of shekels instead of hundreds
  • 🔌 כבל USB רגיל מעלה את הקוד — בלי חומרה מיוחדת🔌 A plain USB cable uploads the code — no special hardware
  • 🆓 תוכנה חינמית ושפה פשוטה (מבוססת C++)🆓 Free software and a simple language (based on C++)
  • 🌍 קוד פתוח + קהילה ענקית — לכל בעיה יש כבר תשובה ברשת🌍 Open source + a huge community — every problem already has an answer online
נולד בשנת 2005 בבית ספר לעיצוב באיבריאה, איטליה, כדי שסטודנטים לא מהנדסים יוכלו לבנות דברים. בדיוק בשביל חדר כמו שלנו.Born in 2005 at a design school in Ivrea, Italy, so that non-engineer students could build things. Exactly for a room like ours.

7למה זה לא מחשבWhy it's not a PC

הארדואינו הוא בקר זעיר (microcontroller): שבב אחד שמריץ תוכנה אחת, שוב ושוב, לנצח. אין לו מערכת הפעלה, אין שולחן עבודה, אין "אפליקציות". הוא נדלק ומיד רץ. The Arduino is a microcontroller: one chip that runs one program, over and over, forever. It has no operating system, no desktop, no "apps". It powers on and runs instantly.

זו בדיוק המעלה שלו: הוא אמין ומיידי. נורה, מנוע, חיישן — דברים שחייבים לקרות עכשיו, בלי ש"ייתקע" או יבקש עדכון באמצע. That's exactly its strength: it's reliable and immediate. LEDs, motors, sensors — things that must happen right now, with nothing freezing or asking to update mid-way.

מחשב מודד זיכרון בג'יגה-בייט. ארדואינו Uno? 2 קילו-בייט של זיכרון עבודה — פי מיליון פחות. ועדיין מספיק להבהב, לנהוג ולמדוד.A PC measures memory in gigabytes. An Arduino Uno? 2 kilobytes of working memory — a million times less. And it's still plenty to blink, drive, and measure.

מירוץ הדלקה: לחצו "הפעל" ותראו מי מוכן קודםPower-on race: hit "turn on" and see who's ready first

8ארדואינו, פטל, מחשב — מי מתי?Arduino, Pi, PC — which one when?

הבלבול הנפוץ ביותר: ארדואינו מול Raspberry Pi ("פטל"). הם נראים דומה — לוח קטן עם חוטים — אבל הם חיות שונות לגמרי. The most common mix-up: Arduino vs Raspberry Pi. They look alike — a small board with pins — but they're completely different animals.

  • ארדואינו = בקר. עושה דבר אחד, בול, בזמן אמת. "שריר ורפלקס".Arduino = a controller. Does one thing, precisely, in real time. "Muscle and reflex".
  • פטל = מחשב מלא עם לינוקס. מריץ מסך, אינטרנט, מצלמה, בינה מלאכותית. "מוח".Pi = a full computer running Linux. Screen, internet, camera, AI. "Brain".
לרוב משלבים: פטל "חושב" את הדברים הכבדים (ראייה ממצלמה), ושולח פקודות לארדואינו שמבצע בזמן אמת. כל אחד במה שהוא טוב.Often you combine them: the Pi "thinks" the heavy stuff (camera vision) and sends commands to an Arduino that executes in real time. Each at what it's good at.
ArduinoRaspberry PiPC
מה זהWhat it isבקרControllerמחשבComputerמחשבComputer
מערכת הפעלהOperating systemאיןNoneLinuxWin/Mac
מוכן לפעולהReady to runמיידיInstant~30 שנ'~30 s~1 דק'~1 min
מריץ בו-זמניתRuns at onceתוכנה אחת1 programהרבהManyהרבהMany
מחבר חוטים ישירותWires things directlyמצויןExcellentבסדרOKלא ממשNot really
זיכרון עבודהWorking memoryקילו-בייטיםKilobytesג'יגה-בייטיםGigabytesג'יגה-בייטיםGigabytes

נורה שמהבהבת / מנוע ← ארדואינו · מצלמה שמזהה פנים ← פטלBlinking LED / motor → Arduino · a camera that recognizes faces → Pi

9התרגיל: גורמים לנורה להבהב 💡The build: make an LED blink 💡

זה נשמע צנוע — אבל "Blink" הוא ה-"שלום עולם" של החומרה. אם נורה מהבהבת בפקודה שלכם, זה אומר שכל השרשרת עובדת: הקוד שלכם ← המחשב ← הכבל ← השבב ← הפין ← החשמל ← אור. מכאן הכול רק גדל. It sounds modest — but "Blink" is the "Hello World" of hardware. If a light blinks on your command, the whole chain works: your code → computer → cable → chip → pin → electricity → light. From here it only grows.

מה צריך על השולחןWhat's on the table

  • לוח ארדואינו + כבל USBAn Arduino board + USB cable
  • חוטי ג'אמפר — נכנסים ישר לשקעי הפיניםJumper wires — they push straight into the pin sockets
  • נורת LED ונגד 220ΩAn LED and a 220Ω resistor

שלושה שלבים + מסלולThree levels + runway

  • שלב 0: נורה נדלקת מ-5V — בלי קוד, רק לראות חשמל עובדLevel 0: an LED lit from 5V — no code, just see electricity work
  • שלב 1: מעלים את Blink — הנורה שבלוח מהבהבת לבדLevel 1: upload Blink — the onboard LED blinks on its own
  • שלב 2: אותו קוד, אבל לנורה שלכם — ישר על הארדואינוLevel 2: same code, but driving your own LED — straight on the Arduino
  • מסלול: כפתור, רמזור, "נשימה" — מי שרץ קדימהRunway: a button, a traffic light, "breathing" — for whoever races ahead

💻 כל קבצי הקוד של השיעורAll of this lesson's code files

10חיבור ישר לארדואינו — 2 דקות תאוריהWiring straight into the Arduino — 2 minutes

איך מחברים — בלי לוח ובלי שילדHow we connect — no breadboard, no shield

הפסים השחורים לאורך הקצוות של הארדואינו הם שקעים. חוט ג'אמפר — או רגל של רכיב — פשוט נדחף פנימה. אנחנו עובדים ישר על הלוח, בלי לוח ניסויים ובלי שילד. The black strips along the Arduino's edges are sockets. A jumper wire — or a component's leg — just pushes in. We work straight on the board, with no breadboard and no shield.

כל שקע = פין אחד, וחוט אחד בכל שקע. כדי לחבר שני דברים (רגל של נגד לרגל של נורה) — משחילים אותם לאותו שקע או מחברים בחוט קצר. Each socket = one pin, one wire per socket. To join two things (a resistor leg to an LED leg) — push them into the same socket, or bridge with a short jumper.

לנורה יש כיוון!An LED has a direction!

  • רגל ארוכה = פלוס (+), נכנס מצד החשמלLong leg = plus (+), goes to the power side
  • רגל קצרה = מינוס (−), יוצא ל-GNDShort leg = minus (−), goes to GND
  • הפוך? פשוט לא נדלקת. לא נשרף. פשוט הופכים.Backwards? It just won't light. Nothing breaks. Just flip it.
⚠️ תמיד נגד בטור עם הנורה. בלעדיו עובר יותר מדי זרם — והנורה "מתפוצצת" (נשרפת) ברגע.⚠️ Always a resistor in series with the LED. Without it too much current flows — and the LED "pops" (burns out) instantly.
נורה + נגד נכנסים ישר לשקעי הארדואינו — פין 9 ו-GNDLED + resistor go straight into the Arduino's sockets — pin 9 and GND

11שלב 0: נורה נדלקת — בלי קודLevel 0: light an LED — no code

לפני שנכתוב שורה אחת, נוכיח שהחשמל עובד. חשמל צריך מעגל סגור — מסלול שלם מ-(+) חזרה ל-(−). אם יש פתח, שום דבר לא זורם. כמו מים בצינור. Before we write a single line, let's prove electricity works. Electricity needs a closed loop — a full path from (+) back to (−). If there's a gap, nothing flows. Like water in a pipe.

המסלולThe path

  • 5V → נגד 220Ω → רגל ארוכה של הנורה5V → 220Ω resistor → LED long leg
  • רגל קצרה של הנורה → GNDLED short leg → GND
זהו. חיברתם — נדלק. זה כל הסיפור של "מעגל". עכשיו נגרום לארדואינו לפתוח ולסגור את המסלול הזה בשבילנו.That's it. Connect it — it lights. That's the whole story of a "circuit". Now we'll make the Arduino open and close that path for us.

לחצו "חבר את החוט" כדי לסגור את המעגל:Press "connect the wire" to close the circuit:

12שלב 1: התוכנה הראשונה שלכםLevel 1: your first program

כל תוכנת ארדואינו בנויה משני חלקים: setup() שרץ פעם אחת בהדלקה, ו-loop() שרץ שוב ושוב לנצח. זו הלולאה מהשקופית הרביעית — עכשיו בקוד. Every Arduino program has two parts: setup() runs once at power-on, and loop() runs over and over, forever. That's the loop from slide 4 — now in code.

const int LED_PIN = 13;  // onboard LED

void setup() {
  pinMode(LED_PIN, OUTPUT);  // we drive this pin
}

void loop() {
  digitalWrite(LED_PIN, HIGH); // on
  delay(500);                  // wait 0.5s
  digitalWrite(LED_PIN, LOW);  // off
  delay(500);
}

📄 code/level1_blink.ino · מעלים עם כפתור ה-→ (Upload) ב-Arduino IDE.📄 code/level1_blink.ino · upload with the → (Upload) button in the Arduino IDE.

גררו את ה-delay וראו את הנורה — בדיוק מה שהקוד עושה:Drag the delay and watch the LED — exactly what the code does:

13שלב 2: הנורה שלכם, על הפין שלכםLevel 2: your LED, on your pin

הנורה שבלוח הייתה חממה. עכשיו נחבר נורה אמיתית שאתם שולטים בה. הסוד הקטן: הקוד כמעט זהה — רק מחליפים את מספר הפין מ-13 ל-9. זה כל ההבדל. The onboard LED was a warm-up. Now we wire a real LED that you control. The little secret: the code is almost identical — we just change the pin number from 13 to 9. That's the whole difference.

const int LED_PIN = 9;   // now OUR led

void setup() { pinMode(LED_PIN, OUTPUT); }

void loop() {
  digitalWrite(LED_PIN, HIGH); delay(300);
  digitalWrite(LED_PIN, LOW);  delay(300);
}

📄 code/level2_external_led.ino📄 code/level2_external_led.ino

החיווטThe wiring

מ-FromאלTo
D9נגד 220Ω220Ω resistor
הנגדresistorרגל ארוכה (+) של הנורהLED long leg (+)
רגל קצרה (−)LED short leg (−)GND
הפין D9 הוא בעצם "5V שאפשר לכבות ולהדליק בתוכנה". HIGH = 5V (נדלק), LOW = 0V (כבוי). זה כל מה ש-digitalWrite עושה. Pin D9 is really "a 5V you can switch on and off in software". HIGH = 5V (lit), LOW = 0V (off). That's all digitalWrite does.

💡 אם לא נדלקת: בדקו את קוטביות הנורה, ושכל רגל באמת יושבת עמוק בשקע.💡 Not lighting? Check the LED's polarity, and that every leg is seated firmly in its socket.

14ריצת מסלול — למי שרץ קדימהRunway — for whoever races ahead

אתגרים בכיתהIn-class challenges

  • כפתור: הנורה נדלקת רק כשלוחצים. פתאום יש קלט — הלולאה המלאה! bonus_button.inoButton: the LED lights only while pressed. Suddenly there's input — the full loop! bonus_button.ino
  • רמזור: 3 נורות בתור — אדום, ירוק, צהוב. bonus_traffic_light.inoTraffic light: 3 LEDs in sequence — red, green, yellow. bonus_traffic_light.ino
  • נשימה: נורה שעולה ויורדת בהדרגה עם analogWrite (PWM). bonus_fade.inoBreathing: an LED fading up and down with analogWrite (PWM). bonus_fade.ino

לשחק איתו בביתPlay at home

  • שנו את ה-delay — מה קורה ב-50? וב-2000?Change the delay — what happens at 50? at 2000?
  • שדרו SOS בקוד מורס (· · · − − − · · ·) בנורהSend SOS in Morse (· · · − − − · · ·) on the LED
  • שתי נורות שמתחלפות — "מצמוץ" של מכונית משטרהTwo LEDs alternating — a police-car "flash"
הכלל הזהב של היום: תשברו דברים בשמחה. הכי גרוע שיקרה — נורה לא נדלקת. מחברים מחדש וממשיכים.Today's golden rule: break things happily. Worst case — an LED doesn't light. Rewire and carry on.

15סיכום — מה לקחנו הביתהSummary — what we take home

הרעיון האחד להיוםThe one idea for today

רובוט = חש ← חושב ← פועל, בלולאה. ארדואינו הוא בקר זעיר וזול שמריץ תוכנה אחת על פינים אמיתיים — לא מחשב, לא פטל, וזו בדיוק המעלה שלו. והיום כתבתם קוד שהזיז אטומים: נורה נדלקה כי אתם אמרתם לה. A robot = sense → think → act, in a loop. An Arduino is a tiny cheap controller that runs one program on real pins — not a PC, not a Pi, and that's exactly its strength. And today you wrote code that moved atoms: a light turned on because you told it to.

המילים החדשותThe new words

setup() · loop() · pinMode · digitalWrite · HIGH/LOW · delay · ג'אמפר · נגדsetup() · loop() · pinMode · digitalWrite · HIGH/LOW · delay · jumper · resistor

בשיעור הבאNext lesson

נוסיף את החלק שחסר בלולאה היום — חישה. ניתן לארדואינו חוש: חיישן שמודד מרחק, כך שהוא יגיב לעולם במקום רק להבהב לפי טיימר. We add the part that was missing from today's loop — sensing. We give the Arduino a sense: a sensor that measures distance, so it reacts to the world instead of just blinking on a timer.

💻 כל קבצי הקוד של השיעור — הורדהAll of this lesson's code — download

כל הכבוד על המפגש הראשון — נתראה בשיעור הבא! 👋Great work on your first session — see you next lesson! 👋