From 74fbf3a3f7f008dd46bd8c0de9e4b200f2323532 Mon Sep 17 00:00:00 2001 From: Angel Toloza Date: Fri, 13 Jan 2023 23:21:22 -0300 Subject: [PATCH] Create ssd1306_i2c_esp32.py --- setup_examples/ssd1306_i2c_esp32.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 setup_examples/ssd1306_i2c_esp32.py diff --git a/setup_examples/ssd1306_i2c_esp32.py b/setup_examples/ssd1306_i2c_esp32.py new file mode 100644 index 0000000..6c7495d --- /dev/null +++ b/setup_examples/ssd1306_i2c_esp32.py @@ -0,0 +1,12 @@ +from machine import Pin, SoftI2C +import gc + +from drivers.ssd1306.ssd1306 import SSD1306_I2C as SSD + +# ESP32 Pin assignment +i2c = SoftI2C(scl=Pin(22), sda=Pin(21)) + +oled_width = 128 +oled_height = 64 +gc.collect() # Precaution before instantiating framebuf +ssd = SSD(oled_width, oled_height, i2c)