0Pricing
Arduino & IoT Academy · درس

توصيل وتهيئة OLED ‏SSD1306

أعد إعداد شاشة OLED من Adafruit عبر I2C.

توصيل وتهيئة OLED ‏SSD1306 درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Meet the OLED

An OLED is a tiny self-lit screen. Each pixel glows on its own, so you get crisp text and sharp graphics with no backlight needed. 💡

The SSD1306 Chip

Most small OLEDs are driven by the SSD1306 controller. It manages the pixels for you, so your code just says what to draw, not how to light each dot.

Just Four Wires

An I2C OLED needs only four pins: VCC, GND, SDA, and SCL. Two for power, two for data. That simple wiring is why these screens are so popular.

Where SDA and SCL Go

On an Arduino Uno, SDA connects to A4 and SCL to A5. These are the board's built-in I2C lines, shared by every I2C device you add.

The I2C Address

Each I2C device answers to an address. Most SSD1306 OLEDs use 0x3C. You pass this number so the board knows which chip it is talking to.

The Adafruit Libraries

You drive the screen with two helpers: Adafruit_SSD1306 for the hardware and Adafruit_GFX for drawing. Install both from the Library Manager.

Include and Size

Start your sketch by including the libraries and stating the screen size. A common panel is 128x64 pixels wide by tall.

#include <Adafruit_SSD1306.h>
#define WIDTH 128
#define HEIGHT 64

Create the Display Object

Make a display object that represents the screen. You hand it the size so every later draw call knows the canvas bounds.

Adafruit_SSD1306 display(WIDTH, HEIGHT, &Wire, -1);

Begin in setup()

Inside setup, call display.begin() with the address 0x3C. This powers up the panel and prepares it to receive your drawings.

display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

Clear the Buffer

Drawing happens in memory first. Call clearDisplay() to wipe that buffer so old pixels do not linger behind your new content.

display.clearDisplay();

Push It to the Screen

Nothing shows until you call display(). It sends the whole buffer to the OLED at once, so changes appear together with no flicker.

display.display();

Quick Check

You set up the screen but it stays blank. What did you forget?

Recap

You wired four pins, included the Adafruit libraries, began the SSD1306 at 0x3C, and learned to clear then push the buffer. Your OLED is ready to draw.

الأسئلة الشائعة

هل درس «توصيل وتهيئة OLED ‏SSD1306» مجاني؟

نعم — نص درس «توصيل وتهيئة OLED ‏SSD1306» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.

ماذا ستتعلم في «توصيل وتهيئة OLED ‏SSD1306»؟

أعد إعداد شاشة OLED من Adafruit عبر I2C. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟

لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «توصيل وتهيئة OLED ‏SSD1306»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟

نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. توصيل وتهيئة OLED ‏SSD1306
  2. رسم النص بأحجام متعددة
  3. الخطوط والمستطيلات والدوائر
  4. تحريك مخطط أعمدة
← العودة إلى Arduino & IoT Academy