# Demonstrate how to use the OLED display # This assumes that you've connected it as follows: # GND -> GND # VCC -> 3.3V # SCL -> D2 # SDA -> D4 from machine import Pin, I2C import ssd1306 from time import sleep i2c = I2C(0, scl=Pin(2), sda=Pin(4)) display = ssd1306.SSD1306_I2C(128, 64, i2c) while True: display.fill(0) display.text("Value: {}".format(12), 5, 5) display.show() sleep(1)