Skip to content

Commit 47c8f65

Browse files
committed
Fix the 280x240 example offsets
1 parent 46ce7f1 commit 47c8f65

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/st7789_280x240_simpletest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@
1515
displayio.release_displays()
1616

1717
spi = board.SPI()
18-
tft_cs = board.D5
19-
tft_dc = board.D6
18+
tft_cs = board.D10
19+
tft_dc = board.D8
2020

2121
display_bus = displayio.FourWire(
2222
spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
2323
)
2424

25-
display = ST7789(display_bus, width=320, height=240, rotation=90)
25+
display = ST7789(display_bus, width=280, height=240, rowstart=20, rotation=90)
2626

2727
# Make the display context
2828
splash = displayio.Group()
2929
display.show(splash)
3030

31-
color_bitmap = displayio.Bitmap(320, 240, 1)
31+
color_bitmap = displayio.Bitmap(280, 240, 1)
3232
color_palette = displayio.Palette(1)
3333
color_palette[0] = 0x00FF00 # Bright Green
3434

3535
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
3636
splash.append(bg_sprite)
3737

3838
# Draw a smaller inner rectangle
39-
inner_bitmap = displayio.Bitmap(280, 200, 1)
39+
inner_bitmap = displayio.Bitmap(240, 200, 1)
4040
inner_palette = displayio.Palette(1)
4141
inner_palette[0] = 0xAA0088 # Purple
4242
inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=20, y=20)
4343
splash.append(inner_sprite)
4444

4545
# Draw a label
46-
text_group = displayio.Group(scale=3, x=57, y=120)
46+
text_group = displayio.Group(scale=3, x=37, y=120)
4747
text = "Hello World!"
4848
text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00)
4949
text_group.append(text_area) # Subgroup for text scaling

0 commit comments

Comments
 (0)