Hello - I’m trying to work with some of the example Micro Python code on the pico explorer, but I keep getting an error saying ‘no module named st7789’. I tried to install it from your GitHub repository, but it still gives me the error. Is there a uf2 file that already includes st7789 in the library?
What version of the Pimoroni uf2 are you using?
The latest one uses PicoGraphics. Code changes are needed to the older examples.
The 1.18.7 uf2 will likely work with the st7789 code.
Oh I think I used 1.19, but even with 1.18.7 I still get the following error:
ImportError: no module named 'st7789'
Should I update the code to use PicoGraphics instead?
I would give it a try. I’m using it with a pico display pack v2.
If you still have problems post back. I have a Pico Breakout garden and a 240x240 LCD breakout to test with.
Try this with the latest 1.19 release. I just tried it on my Pico Breakout Garden Pack. The front display worked with the following code. I have a 240x240 LCD breakout plugged into the front SPI slot. The Pico Explorer LCD used the same pins.
import picographics
from picographics import PicoGraphics, DISPLAY_PICO_EXPLORER
display = PicoGraphics(display=DISPLAY_PICO_EXPLORER)
display.set_backlight(1.0)
white = display.create_pen(255, 255, 255)
black = display.create_pen(0, 0, 0)
display.set_pen(white)
display.text("Pico", 75, 20, 240, 4)
display.text("Explorer", 30, 45, 240, 4)
display.text("Display", 40, 70, 240, 4)
display.text("Test", 70, 95, 240, 4)
display.update()
display.set_pen(black)
display.clear()
awesome, thank you!
This worked for some things, but I’m still having trouble figuring out how to use PicoGraphics instead of st7789 for the following:
display.set_palette_mode(st7789.PALETTE_USER)
Any ideas on that one?
Have a look see at this. Looks a little complicated?
At some point the examples will be updated for the new Pico Graphics. It only just got finalized / released today. Coinciding with the Tufty 2040 release.
There is a contact us link on the shop page, that you can use to Contact Pimoroni directly.
Contact Us for Raspberry Pi Technical Support - Pimoroni
oof. Yeah it does look a bit more complicated than st7789. I’ll try contacting Pimoroni as well. Thanks again!
You likely won’t get a replay back until Monday some time.
Do you need a custom palate?
To create custom colors just do a
custom1 = display.create_pen(255, 140, 0)
custom2 = display.create_pen(140,140, 140)
etc.