frame buffer console class for MicroPython
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Framebuffer console class for MicroPython.

You can redirect REPL to any framebuffer devices.


The example below duplicates REPL output to SSD1306 OLED connected to ESP32 via I2C(SDA=Pin22, SCL=Pin21).

from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
i2c = I2C(scl=Pin(21), sda=Pin(22), freq=400000)
oled = SSD1306_I2C(128, 64, i2c)

from fbconsole import FBConsole
import os
scr = FBConsole(oled)
os.dupterm(scr)        # redirect REPL output to OLED
help()                 # and print something
os.dupterm(None)       # then disconnect OLED from REPL
scr.cls()              # and clear OLED screen