Skip to content

asathiskumar98-byte/ESP8266-OLED-Display-2-SSD1306-I-C-MicroPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🖥️ ESP8266 OLED Display (SSD1306 I²C) — MicroPython

🧠 Overview

This project demonstrates how to interface an SSD1306 OLED Display (128x64) with the ESP8266 using I²C communication in MicroPython.
The example introduces a reusable function oled_string() for displaying dynamic text messages on the OLED.


⚙️ Hardware Setup

Component ESP8266 Pin Description
OLED (SCL) GPIO5 (D1) Serial Clock Line
OLED (SDA) GPIO4 (D2) Serial Data Line
VCC 3.3V Power supply
GND GND Common ground

🪛 Connections:

  • D1 (GPIO5)SCL
  • D2 (GPIO4)SDA
  • 3.3VVCC
  • GNDGND

🧩 Code

from machine import Pin
from machine import I2C
import ssd1306

# D1 = SCL = GPIO5
# D2 = SDA = GPIO4

i2c = I2C(sda=Pin(4), scl=Pin(5))
display = ssd1306.SSD1306_I2C(128, 64, i2c)

def oled_string(x, y, z, c):
    display.fill(0)  # Clear display
    display.text(x, y, z, c)
    display.show()

oled_string('OLED Display', 20, 32, 1)

About

This project demonstrates how to interface an **SSD1306 OLED Display (128x64)** with the **ESP8266** using **I²C communication** in **MicroPython**. The example introduces a reusable function `oled_string()` for displaying dynamic text messages on the OLED.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages