RyeRye
1
Hello
Very new to coding, im trying to connect the display pack 2.8 and pico 2 however when running a programme its coming up with
MPY: soft reboot
Traceback (most recent call last):
File “”, line 4, in
ImportError: no module named ‘picographics’
I have downloaded and flashed the latest firmware i can find on github
Any help would be majorly appreciated
RyeRye
2
Here is my code
from time import sleep
from machine import Pin, PWM
from picographics import PicoGraphics, DISPLAY_PICO_DISPLAY_2
import jpegdec
import gc
gc.collect()
display = PicoGraphics(DISPLAY_PICO_DISPLAY_2, rotate=180)
WIDTH, HEIGHT = display.get_bounds()
SCALE = 1.25 # Font scale for words
COUNT_SCALE = 0.75 # Font scale for word count
SPACING = 1
WORD_WRAP = WIDTH - 2
print(f’Width {WIDTH}, Height {HEIGHT}')
white = {‘red’: 255, ‘green’: 255, ‘blue’: 255}
black = {‘red’: 0, ‘green’: 0, ‘blue’: 0}
def draw_jpg(display, filename):
j = jpegdec.JPEG(display)
# Open the JPEG file
j.open_file(filename)
WIDTH, HEIGHT = display.get_bounds()
display.set_clip(0, 0, WIDTH, HEIGHT)
j.decode(0, 0, jpegdec.JPEG_SCALE_FULL)
display.remove_clip()
display.update()