Skip to content

Instantly share code, notes, and snippets.

@raspberrytipsnl
Created March 6, 2017 13:23
Show Gist options
  • Save raspberrytipsnl/3d89c1bfb83506452a87c516b46dda21 to your computer and use it in GitHub Desktop.
Save raspberrytipsnl/3d89c1bfb83506452a87c516b46dda21 to your computer and use it in GitHub Desktop.
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
disp = Adafruit_SSD1306.SSD1306_128_32(rst=24)
disp.begin()
disp.clear()
disp.display()
image = Image.new('1', (disp.width, disp.height))
draw = ImageDraw.Draw(image)
draw.rectangle((0,0,disp.width-1,disp.height-1), outline=1, fill=0)
font = ImageFont.load_default()
draw.text((16, 8),'RASPBERRYTIPS.NL', font=font, fill=255)
disp.image(image)
disp.display()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment