אין צורך בשום ניסיון קודם. עד סוף השיעור כל אחד כאן יכתוב תוכנה קטנה, יחבר כמה חוטים — ויגרום לנורה אמיתית להבהב. זה נשמע קסם; זה פשוט חשמל והיגיון. 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.
ניווט: חצים ← → במקלדת, או הכפתורים למטה · לחצו EN למונחים באנגלית Navigate: ← → arrow keys, or the buttons below · press עב for Hebrew
שכחו לרגע מסרטים. רובוט הוא כל דבר שעושה שלושה דברים: חש את העולם, מחליט מה לעשות, ופועל עליו. זהו. בלי זרועות מתכת ובלי עיניים אדומות. 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:
הלולאה הזאת — חש ← חושב ← פועל ← חש… — חוזרת על עצמה אלפי פעמים בשנייה, לנצח, כל עוד יש חשמל. כל רובוט שנבנה בקורס הוא בסך הכול גרסה של הלולאה הזו. 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.
ארדואינו הוא מחשב זעיר וזול על לוח אחד, שתוכנן כדי שתוכלו לחבר אליו חוטים ולשלוט בעולם האמיתי. עולה בערך כמו שתי כוסות קפה, ושורד גם אם תחברו משהו הפוך (בדרך כלל). 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:
(לוח לדוגמה: Arduino Uno — הנפוץ ביותר ללימוד)(Example board: Arduino Uno — the most common for learning)
הארדואינו הוא בקר זעיר (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.
מירוץ הדלקה: לחצו "הפעל" ותראו מי מוכן קודםPower-on race: hit "turn on" and see who's ready first
הבלבול הנפוץ ביותר: ארדואינו מול 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 | Raspberry Pi | PC | |
|---|---|---|---|
| מה זהWhat it is | בקרController | מחשבComputer | מחשבComputer |
| מערכת הפעלהOperating system | איןNone | Linux | Win/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
זה נשמע צנוע — אבל "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.
הפסים השחורים לאורך הקצוות של הארדואינו הם שקעים. חוט ג'אמפר — או רגל של רכיב — פשוט נדחף פנימה. אנחנו עובדים ישר על הלוח, בלי לוח ניסויים ובלי שילד. 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.
לפני שנכתוב שורה אחת, נוכיח שהחשמל עובד. חשמל צריך מעגל סגור — מסלול שלם מ-(+) חזרה ל-(−). אם יש פתח, שום דבר לא זורם. כמו מים בצינור. 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.
לחצו "חבר את החוט" כדי לסגור את המעגל:Press "connect the wire" to close the circuit:
כל תוכנת ארדואינו בנויה משני חלקים: 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 ל-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
| מ-From | אלTo |
|---|---|
| D9 | נגד 220Ω220Ω resistor |
| הנגדresistor | רגל ארוכה (+) של הנורהLED long leg (+) |
| רגל קצרה (−)LED short leg (−) | GND |
💡 אם לא נדלקת: בדקו את קוטביות הנורה, ושכל רגל באמת יושבת עמוק בשקע.💡 Not lighting? Check the LED's polarity, and that every leg is seated firmly in its socket.
רובוט = חש ← חושב ← פועל, בלולאה. ארדואינו הוא בקר זעיר וזול שמריץ תוכנה אחת על פינים אמיתיים — לא מחשב, לא פטל, וזו בדיוק המעלה שלו. והיום כתבתם קוד שהזיז אטומים: נורה נדלקה כי אתם אמרתם לה. 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.
setup() · loop() · pinMode · digitalWrite · HIGH/LOW · delay · ג'אמפר · נגדsetup() · loop() · pinMode · digitalWrite · HIGH/LOW · delay · jumper · resistor
נוסיף את החלק שחסר בלולאה היום — חישה. ניתן לארדואינו חוש: חיישן שמודד מרחק, כך שהוא יגיב לעולם במקום רק להבהב לפי טיימר. 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! 👋