Skip to content

Instantly share code, notes, and snippets.

@tiede
Created September 17, 2023 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiede/dd233d2046062616b6de263894e8b7ae to your computer and use it in GitHub Desktop.
Save tiede/dd233d2046062616b6de263894e8b7ae to your computer and use it in GitHub Desktop.
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