From 952cb4e825294fbc014a615ac477edcfb974980d Mon Sep 17 00:00:00 2001 From: Kevin McAleer Date: Mon, 20 Jun 2022 21:11:19 +0100 Subject: [PATCH] updated PicoGraphics README and .gitignore --- .gitignore | 4 ++++ micropython/modules/picographics/README.md | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 89929922..920b6f1a 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ **/build .vscode + +# Apple filesystem cruft +.DS_Store +venv \ No newline at end of file diff --git a/micropython/modules/picographics/README.md b/micropython/modules/picographics/README.md index 81bd8915..2641de2f 100644 --- a/micropython/modules/picographics/README.md +++ b/micropython/modules/picographics/README.md @@ -78,7 +78,7 @@ All SPI LCDs support 0, 90, 180 and 270 degree rotations. Eg: ```python -display = PicoGraphics(display=PICO_DISPLAY, roation=90) +display = PicoGraphics(display=PICO_DISPLAY, rotate=90) ``` ### Custom Pins @@ -362,12 +362,25 @@ We've prepared some RGB332-compatible sprite assets for you, but you can use `sp #### Loading Sprites +You'll need to include the [pen_type](#supported-graphics-modes-pen-type) in the import statement, and define the pen_type before using loading the spritesheet: + +``` python +from picographics import PicoGraphics, PEN_RGB565, PEN_RGB332 + +display = PicoGraphics(display=PICO_DISPLAY, pen_type=PEN_RGB332) +``` Use Thonny to upload your `spritesheet.rgb332` file onto your Pico. Then load it into Pico Graphics: ```python display.load_spritesheet("s4m_ur4i-dingbads.rgb332") ``` +and then update the display, to show the sprite: + +```python +display.update() +``` + #### Drawing Sprites And finally display a sprite: