Also, do I need another library to specify background color? Currently, the line of code: background = GREEN doesn't change the background color.
Code: Select all
import board
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text import label
# Hex Colors
WHITE = 0xFFFFFF
RED = 0xFF0000
YELLOW = 0xFFFF00
GREEN = 0x00FF00
BLUE = 0x0000FF
PURPLE = 0xFF00FF
BLACK = 0x000000
ORANGE = 0xC91818
display = board.DISPLAY
background = GREEN
message = "Hello World!"
message2 = "Hello Galaxy!"
# Set text, font, and color and !
text = (message)
font = bitmap_font.load_font("fonts/Helvetica-Bold-16.bdf")
color = ORANGE
# Create the text label
text_area = label.Label(font, text=text, color=color)
# Set the location
text_area.x = 90
text_area.y = 120
# Show it
display.show(text_area)
# Loop forever so you can enjoy your text
while True:
pass