Skip to content

Commit 417a68c

Browse files
author
JPOSADA202020
committed
improving_labels_loc
1 parent a39983e commit 417a68c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/bmp280_displayio_simpletest.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727

2828
# place the labels in the middle of the screen with anchored positioning
2929
tempandpress_output_label.anchor_point = (0, 0)
30-
tempandpress_output_label.anchored_position = (4, board.DISPLAY.height // 2)
30+
tempandpress_output_label.anchored_position = (
31+
4,
32+
board.DISPLAY.height // 2 - 40,
33+
)
3134
altitude_output_label.anchor_point = (0, 0)
3235
altitude_output_label.anchored_position = (4, board.DISPLAY.height // 2 + 20)
3336

@@ -43,7 +46,7 @@
4346
while True:
4447
# Update the label.text property to change the text on the display
4548
tempandpress_output_label.text = (
46-
f"Temperature:{bmp280.temperature:0.1f} C, Pressure:{bmp280.pressure:0.1f} hPa"
49+
f"Temperature:{bmp280.temperature:0.1f} C \nPressure:{bmp280.pressure:0.1f} hPa"
4750
)
4851
altitude_output_label.text = f"Altitude:{bmp280.altitude:0.2f} mts"
4952
# wait for a bit

0 commit comments

Comments
 (0)