مكتبة LiquidCrystal_I2C
هيّئ الشاشة واضبط عنوانها.
مكتبة LiquidCrystal_I2C درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What the Library Does
The LiquidCrystal_I2C library handles all the low-level I2C chatter for you. You just call simple commands to show text. 📚
Install It Once
Open the Library Manager in the Arduino IDE and search for LiquidCrystal_I2C. Click install and it is ready to use.
Include the Header
At the top of your sketch you add an include line so the compiler can find the library's code.
#include <LiquidCrystal_I2C.h>Create the Object
You make one lcd object that represents your display. Every command you give will go through this object.
LiquidCrystal_I2C lcd(0x27, 16, 2);The Address Argument
The first number is the I2C address. If your display stays blank, swap 0x27 for 0x3F, the other common value.
Columns and Rows
The next two numbers tell the library the size: 16 columns and 2 rows. This matches a standard 16x2 panel.
Initialize in setup
Inside setup you call lcd.init() once to wake the display and prepare it to receive text.
void setup() {
lcd.init();
}Turn On the Backlight
The screen starts dark until you call lcd.backlight(). This lights it up so the characters are readable.
lcd.backlight();Print Your First Word
Now lcd.print() sends text to the screen. Whatever you pass appears starting at the top-left corner. 🎉
lcd.print("Hello!");Clearing the Screen
Call lcd.clear() to wipe everything and move the cursor back to the start before writing fresh text.
lcd.clear();If It Stays Blank
Blank screen with backlight on usually means the wrong address. Run an I2C scanner sketch to find the real one.
Quick Check
Your sketch compiles but the LCD stays dark even with power. Which call did you likely forget?
Recap
You included LiquidCrystal_I2C, created an lcd object with its address and size, then called init and backlight. Your display is alive. ✅
الأسئلة الشائعة
هل درس «مكتبة LiquidCrystal_I2C» مجاني؟
نعم — نص درس «مكتبة LiquidCrystal_I2C» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
ماذا ستتعلم في «مكتبة LiquidCrystal_I2C»؟
هيّئ الشاشة واضبط عنوانها. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟
لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «مكتبة LiquidCrystal_I2C»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟
نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- توصيل شاشة LCD مقاس 16x2 (I2C Backpack)
- مكتبة LiquidCrystal_I2C
- تحديد موضع Cursor والطباعة
- لوحة بيانات مباشرة للمستشعرات