Last active
April 14, 2018 18:35
-
-
Save codelectron/e5cf4806272867585d233b6fadae2252 to your computer and use it in GitHub Desktop.
This luma oled example code is part of the article http://codelectron.com/setup-oled-display-raspberry-pi-python/
This file contains hidden or 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
| from PIL import ImageFont, ImageDraw | |
| from luma.core.interface.serial import i2c | |
| from luma.core.render import canvas | |
| from luma.oled.device import ssd1306, ssd1325, ssd1331, sh1106 | |
| import time | |
| serial = i2c(port=1, address=0x3C) | |
| device = ssd1306(serial, rotate=0) | |
| # Box and text rendered in portrait mode | |
| with canvas(device) as draw: | |
| draw.line((0,0 , 20 , 20 ), fill="white") | |
| raw_input("Enter to exit") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment