Screen
The screen is a powerful output device, it is capable of rendering text, colours and complex graphics.
Last updated
The screen is a powerful output device, it is capable of rendering text, colours and complex graphics.
Last updated
import board
import terminalio
from adafruit_display_text import label
display = board.DISPLAY
# Set text, font, and color
text = "HELLO WORLD"
font = terminalio.FONT
color = 0x0000FF
# Create the text label
text_area = label.Label(font, text=text, color=color)
# Set the location
text_area.x = 50
text_area.y = 80
# Show it
display.show(text_area)
# Loop forever so you can enjoy your image
while True:
passimport board
import time
import displayio
display = board.DISPLAY
splash = displayio.Group()
display.show(splash)
color_bitmap = displayio.Bitmap(160, 128, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)
# Loop forever so you can enjoy your image
while True:
passimport board
import time
import terminalio
from adafruit_display_text import label
import random
display = board.DISPLAY
# Set text, font, and color
text = "StudioBot"
font = terminalio.FONT
color = 0x0000FF # Blue
# Create the text label
text_area = label.Label(font, text=text, color=color)
x = 50
y = 80
x_direction = 1
y_direction = 1
# Set the location
text_area.x = x
text_area.y = y
# Show it
display.show(text_area)
# Loop forever so you can enjoy your image
while True:
x = x + 1 * x_direction
y = y + 1 * y_direction
if x >= 150:
x_direction = -1
text_area.color = random.randint(0, 0xFFFFFF)
elif x <= 0:
x_direction = 1
text_area.color = random.randint(0, 0xFFFFFF)
if y >= 120:
y_direction = -1
text_area.color = random.randint(0, 0xFFFFFF)
elif y <= 0:
y_direction = 1
text_area.color = random.randint(0, 0xFFFFFF)
text_area.x = x
text_area.y = y
time.sleep(0.01)