Display OLED SSD1306 with LilyGO T-Beam

Updated on 12 April 2022
dev board LilyGO T-Beam
chip ESP32-DOWDQ6
chip SSD1306
features display oled
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Buy the components

Code

Download code display-esp32-t-beam.ino
#include "src/oled/oled.h"

void setup() {
  Serial.begin(9600);
  initOLED();
}

void loop() {
  Serial.print("Updating display at ");
  Serial.print(millis());
  Serial.println("ms");

  displayOLED();
  delay(2000);
}

Makefile

BOARD?=esp32:esp32:t-beam
PORT?=/dev/cu.SLAB_USBtoUART

.PHONY: default lint all flash clean

default: all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD)

clean:
	rm -r build

Prototype

A photo of the actual setup.

Display OLED SSD1306 with LilyGO T-Beam prototype

Serial console

Serial output from the firmware.

Display OLED SSD1306 with LilyGO T-Beam serial console

Description

This example contains the code to display a bunch of Hello world on the OLED display SSD1306.

  1. Install Arduino library dependancy for the OLED display SSD1306

     arduino-cli lib install "ESP8266 and ESP32 OLED driver for SSD1306 displays"
    
  2. Run make to compile and upload the code
  3. Connect to the serial monitor

References

Watch