1

I am currently programming a Raspberry Pi Pico with the explorer base, and I am using the examples at https://github.com/pimoroni/pimoroni-pico (NOTE: I am using MicroPython in the Thonny IDE to program this). I have figured out how to use the push buttons on the board, but whenever I run my code, it gets this error: Thonny error code:

Code

(image used for better readability)

5
  • 1
    Looks like you have to call pico.init(buffer) to initialise the display. github.com/pimoroni/pimoroni-pico/blob/main/micropython/…
    – CoderMike
    Nov 9, 2021 at 22:19
  • 3
    please, no pictures of text ... include the actual text instead ... delete the pictures
    – jsotola
    Nov 9, 2021 at 22:32
  • 1
    I do not see how this helps. This is showing to use a ByteArray on the display, and not the button.
    – dbubbis
    Nov 10, 2021 at 0:48
  • Never mind, me just being dumb. The code worked! Thank you. Please post an answer so I can close the question.
    – dbubbis
    Nov 10, 2021 at 0:59
  • Rename /home/pi/pico.py to ANY other name. Your program is trying to load itself when it attempts to load the pico library function.
    – Dougie
    Nov 11, 2021 at 19:44

1 Answer 1

3

Looks like you have to call pico.init(buffer) (where buffer is an existing bytearray) to initialise the display.

https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/pico_explorer/buttons.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.