Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from board import SCL, SDA
import busio
from PIL import Image, ImageDraw
import adafruit_ssd1306
# Create the I2C interface.
i2c = busio.I2C(SCL, SDA)
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
# Clear display.
# Create blank image for drawing and blank it
width = disp.width
height = disp.height
image ="1", (width, height))
# Get drawing object to draw on image.
draw = ImageDraw.Draw(image)
# Draw a black filled box to clear the image.
draw.rectangle((0, 0, width, height), outline=0, fill=0)
# ... Draw things using PIL ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment