Skip to content

Commit 076bfa6

Browse files
authored
Merge pull request #43 from TheMindVirus/main
Add Display Example to CircuitPython_Cheatsheet.md
2 parents 91c7424 + 667de2d commit 076bfa6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

cheatsheet/CircuitPython_Cheatsheet.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,19 @@ You can use a PWM in one of two ways.
262262
while cpx.button_b: # Wait for button B to be released
263263
pass
264264
m.release(Mouse.RIGHT_BUTTON)
265+
266+
## Display ##
267+
268+
import board, displayio
269+
270+
bitmap = displayio.Bitmap(320, 240, 3)
271+
bitmap[0, 0] = 0
272+
palette = displayio.Palette(1)
273+
palette[0] = 0xFFFFFF
274+
tilegrid = displayio.TileGrid(bitmap, pixel_shader = palette)
275+
group = displayio.Group()
276+
group.append(tilegrid)
277+
board.DISPLAY.show(group)
278+
279+
# Ctrl+D and any key to re-enter the REPL on-screen
280+

0 commit comments

Comments
 (0)