تشغيل عدة أجهزة على ناقل واحد
شارك I2C بين شاشة LCD ومستشعر.
تشغيل عدة أجهزة على ناقل واحد درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Share the Same Wires
The real power of I2C is sharing. An LCD and a sensor can sit on the same two wires at once. 🔗
Addresses Keep Order
Because every device has a unique address, the master talks to each one in turn without any of them getting confused.
Wire Them in Parallel
Connect every device's SDA to SDA and SCL to SCL. They all sit in parallel on the same shared bus lines.
One Set of Pull-Ups
The whole bus needs only one pair of pull-up resistors, not one per device. Many breakouts already include theirs.
Beware Address Clashes
Two devices sharing one address will conflict. Run your scanner first to spot duplicates before wiring everything together.
Change an Address
Many boards let you change the address with a solder jumper or pin. That frees you to run two identical sensors at once.
One Wire.begin for All
You call Wire.begin() just once. Every library on the bus shares that single connection no matter how many devices you add.
void setup() {
Wire.begin();
}Each Library Knows Its Address
You give each library the device's address when you create it, so calls route to the right chip automatically.
LiquidCrystal_I2C lcd(0x27, 16, 2);Talk to Each in the Loop
In loop, read the sensor, then update the LCD. The bus handles one conversation at a time, so order is fine.
float t = sensor.readTemp();
lcd.print(t);Keep Wires Short
Long shared wires add noise and can break the bus. Keep I2C runs short and tidy for reliable communication.
Scale Up Your Projects
With this skill you can grow a project by simply adding more I2C modules, all on the same two trusty wires. 🚀
Quick Check
What happens if two I2C devices share the same address?
Recap
You can now wire multiple I2C devices in parallel, avoid address clashes, and address each one to build bigger projects. ✅
الأسئلة الشائعة
هل درس «تشغيل عدة أجهزة على ناقل واحد» مجاني؟
نعم — نص درس «تشغيل عدة أجهزة على ناقل واحد» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
ماذا ستتعلم في «تشغيل عدة أجهزة على ناقل واحد»؟
شارك I2C بين شاشة LCD ومستشعر. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟
لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «تشغيل عدة أجهزة على ناقل واحد»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟
نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- كيف يتخاطب I2C عبر سلكين
- البحث عن عناوين I2C
- كيف ينقل SPI البيانات بسرعة
- تشغيل عدة أجهزة على ناقل واحد