K Kapnula
⌨️
الدرس 3 · صف 12+

Arduino code: setup, loop and the Serial Monitor

📖 الدرس ──▶ 🎯 اختبار — اختر الترجمة ──▶ ✅ أُنجز الدرس
</>

A sketch is simplified C++. setup() — preparation: pinMode, Serial.begin(9600). loop() — the main loop. Serial.println("text") sends text to the computer — open the Serial Monitor and see what the board is "thinking": your main debugging tool. Variables: int sensor = analogRead(A0); if (sensor > 500) { ... }. A code error → it won’t compile, the IDE underlines the line. Typical traps: a forgotten ; at line end and delay(), which "freezes" the whole board.

⌨️ The Arduino IDE ships ~100 ready examples (File → Examples): from Blink to a Wi-Fi server. Even pros start projects from examples — that’s not shameful, it’s normal.
🎯
اختبر نفسك!
ثبّت الموضوع بالمدرّب — كما بعد الحصة
اختبار — اختر الترجمة → 🖨 ورقة عمل
← السابق التالي →
⛅ 15° Potsdam 💨 11 km/h
💶 EUR 🇺🇸 1.12 USD 🇷🇺 93.87 RUB 🇵🇱 4.39 PLN 🇺🇦 50.32 UAH EZB · daily