Created
September 17, 2023 18:21
-
-
Save tiede/dd233d2046062616b6de263894e8b7ae to your computer and use it in GitHub Desktop.
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
import board | |
import displayio | |
import terminalio | |
import time | |
import random | |
from adafruit_display_text import label | |
SCREEN_WIDTH = 160 | |
SCREEN_HEIGHT = 128 | |
FPS = 60 | |
splash = displayio.Group() | |
board.DISPLAY.show(splash) | |
text = "Hej kodepirater" | |
font = terminalio.FONT | |
color = 0x0000FF | |
# Skift farve | |
color = 0xFF0010 | |
text_area = label.Label(font, text=text, color=color) | |
# Flyt position | |
text_area.x = 10 | |
text_area.y = 10 | |
splash.append(text_area) | |
inc = 1 | |
while True: | |
text_area.x = text_area.x + inc | |
if text_area.x > SCREEN_WIDTH - 88: | |
inc = -1 | |
elif text_area.x < 0: | |
inc = 1 | |
time.sleep(0.015) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment