Created
March 6, 2017 13:23
-
-
Save raspberrytipsnl/3d89c1bfb83506452a87c516b46dda21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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