Closed
Description
If using a font which is taller than terminalio.FONT
the rows overlap because an assumed height is hard-coded.
A variant of the simpletext with a bigger font
"""Display the microcontroller CPU temperature in C and F on a display."""
import microcontroller
from adafruit_simple_text_display import SimpleTextDisplay
from adafruit_bitmap_font import bitmap_font
FONT = bitmap_font.load_font("/fonts/LibreBodoniv2002-Bold-27.bdf") # A bigger font
temperature_data = SimpleTextDisplay(title="Temperature Data!", title_scale=2, font=FONT)
while True:
temperature_data[0].text = "Temperature: {:.2f} degrees C".format(
microcontroller.cpu.temperature
)
temperature_data[1].text = "Temperature: {:.2f} degrees F".format(
(microcontroller.cpu.temperature * (9 / 5) + 32)
)
temperature_data.show()
Metadata
Metadata
Assignees
Labels
No labels