Conectar e inicializar una OLED SSD1306
Configure la OLED de Adafruit mediante I2C.
Conectar e inicializar una OLED SSD1306 es una lección gratuita de Arduino & IoT Academy en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Arduino & IoT Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Arduino & IoT Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
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 64Create 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.
Preguntas frecuentes
¿La lección «Conectar e inicializar una OLED SSD1306» es gratis?
Sí — el texto completo de «Conectar e inicializar una OLED SSD1306» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Arduino & IoT Academy, actualiza a CoddyKit PRO. El curso de Arduino & IoT Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Conectar e inicializar una OLED SSD1306»?
Configure la OLED de Adafruit mediante I2C. Practicas Arduino & IoT Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar Arduino & IoT Academy?
No se requiere experiencia previa. Arduino & IoT Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.
¿Cuánto tiempo toma la lección «Conectar e inicializar una OLED SSD1306»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de Arduino & IoT Academy?
Sí. Cada lección de Arduino & IoT Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Conectar e inicializar una OLED SSD1306
- Dibujar texto en varios tamaños
- Líneas, rectángulos y círculos
- Animar un gráfico de barras