كيف يتخاطب I2C عبر سلكين
شرح SDA وSCL وعناوين الأجهزة.
كيف يتخاطب I2C عبر سلكين درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Two Wires, Many Devices
I2C lets many chips share just two wires, so you can add sensors and screens without running out of pins. 🔌
Meet SDA and SCL
I2C uses two lines: SDA carries the data, and SCL carries the clock pulses that keep both sides perfectly in step.
The Clock Keeps Time
The SCL clock line ticks like a metronome. Every tick tells devices exactly when to read the next bit on the data line.
Master and Slaves
Your Arduino is the master: it starts every conversation. Sensors and displays are slaves that only answer when called.
Every Device Has an Address
Each chip on the bus owns a unique address, usually a 7-bit number. The master uses it to talk to exactly one device. 📬
How a Message Begins
The master sends a start signal, then the target address. The matching device replies, and the rest stay quiet on the shared lines.
Pull-Up Resistors Are Required
I2C lines need pull-up resistors to 3.3V or 5V. Without them the bus floats and your devices simply will not respond.
Boards on the Uno
On an Arduino Uno, SDA is pin A4 and SCL is pin A5. Many breakout boards include their own pull-ups already.
The Wire Library
Arduino talks I2C through the built-in Wire library. One include line gives you everything you need to start communicating.
#include <Wire.h>Begin the Bus
Call Wire.begin() in setup to join the bus as master. After that you can send to any device by its address.
void setup() {
Wire.begin();
}Why I2C Wins
Because devices share two lines, I2C keeps wiring simple and your pins free. That is why so many modules use it.
Quick Check
Which two lines does I2C use to communicate?
Recap
You learned that I2C shares two wires, SDA and SCL, with a master, addressed slaves, and pull-ups. Two wires, many devices. ✅
الأسئلة الشائعة
هل درس «كيف يتخاطب I2C عبر سلكين» مجاني؟
نعم — نص درس «كيف يتخاطب I2C عبر سلكين» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
ماذا ستتعلم في «كيف يتخاطب I2C عبر سلكين»؟
شرح SDA وSCL وعناوين الأجهزة. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟
لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «كيف يتخاطب I2C عبر سلكين»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟
نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- كيف يتخاطب I2C عبر سلكين
- البحث عن عناوين I2C
- كيف ينقل SPI البيانات بسرعة
- تشغيل عدة أجهزة على ناقل واحد