0Pricing
Arduino & IoT Academy · Aula

Conecte e inicialize um OLED SSD1306

Configure o OLED da Adafruit por meio de I2C.

Conecte e inicialize um OLED SSD1306 é uma aula grátis de Arduino & IoT Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Arduino & IoT Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Arduino & IoT Academy inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em 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 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.

Perguntas Frequentes

A aula “Conecte e inicialize um OLED SSD1306” é grátis?

Sim — o texto completo de “Conecte e inicialize um OLED SSD1306” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Arduino & IoT Academy, atualize para CoddyKit PRO. O curso de Arduino & IoT Academy inclui 4 aulas no total.

O que vou aprender em “Conecte e inicialize um OLED SSD1306”?

Configure o OLED da Adafruit por meio de I2C. Você pratica Arduino & IoT Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Arduino & IoT Academy?

Nenhuma experiência prévia é necessária. Arduino & IoT Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.

Quanto tempo leva a aula “Conecte e inicialize um OLED SSD1306”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Arduino & IoT Academy?

Sim. Cada aula de Arduino & IoT Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Conecte e inicialize um OLED SSD1306
  2. Desenhe texto em vários tamanhos
  3. Linhas, retângulos e círculos
  4. Anime um gráfico de barras
← Voltar para Arduino & IoT Academy