Created
July 29, 2020 14:45
-
-
Save hierophect/5bbd2c96dda26f65e945116e6d5eb90c to your computer and use it in GitHub Desktop.
sketcharoo
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 digitalio | |
import terminalio | |
import board | |
import displayio | |
import adafruit_il0398 | |
from babel.babelflash import FlashBabel | |
from adafruit_display_text import label | |
import time | |
# cs = digitalio.DigitalInOut(board.D4) | |
# babel = FlashBabel(cs) | |
displayio.release_displays() | |
spi = board.SPI() # Uses SCK and MOSI | |
epd_cs = board.D9 | |
epd_dc = board.D10 | |
epd_reset = board.A4 | |
epd_busy = board.A3 | |
# Create the displayio connection to the display pins | |
display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, | |
reset=epd_reset, baudrate=1000000) | |
# time.sleep(1) # Wait a bit | |
# Create the display object - the third color is red (0xff0000) | |
DISPLAY_WIDTH = 400 | |
DISPLAY_HEIGHT = 300 | |
display = adafruit_il0398.IL0398(display_bus, width=DISPLAY_WIDTH, | |
height=DISPLAY_HEIGHT, | |
rotation=0, busy_pin=epd_busy, | |
highlight_color=0x000000) | |
display.show(None) | |
# text = """Short sayings: | |
# जान है तो जहान है | |
# 風向轉變時,有人築牆,\n有人造風車 | |
# Один в поле не воин. | |
# ἄνθρωπος μέτρον | |
# """ | |
# text = "ありがとございます" | |
text = "HelloworldHelloworldHelloworld\n \ | |
HelloworldHelloworldHelloworldHelloworld\n \ | |
HelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworldHelloworld" | |
text = "Helloworld" | |
text_area = label.Label(terminalio.FONT, text=text, color=0xFF0000) #babel.font | |
text_area.x = 120 | |
text_area.y = 150 | |
display.show(text_area) | |
display.refresh() | |
while True: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment