Raspberry Pi Pico & giving the Pimoroni Pico Explorer a workout

Tony Goodhew has written up a great Instructable to help you get the most out of the Pimoroni Pico Explorer using the Pimoroni MicroPython firmware.

He uses the screen to do various drawing exercises at a low level (circles, squares, that sort of thing) and also some mathematical function rendering. He finishes off by taking a potentiometer and an LED, using them in combination with PWM to create a dimmable lamp with a graphical readout of the pot level on the screen. You can take a look at the Instructable here.

Create a miniature version of Space Invaders on an LCD screen with the Raspberry Pi Pico and MicroPython

James from Print N Play has taken his Raspberry Pi Pico, a mini SSD1306 screen and a potentiometer and created a (very) miniature version of arcade classic Space Invaders. You can see how he did it in his very detailed video below. One of the great things about the video is that you can see how to install a required library onto the Pico from Thonny. You can see his MicroPython code on GitHub here.

Thanks to Les Pounder over at Tom’s Hardware for spotting this one.

Use your Raspberry Pi Pico as a HID device to give mouse and keyboard input using Adafruit’s CircuitPython

Hriday Barot has written up a couple of example scripts for the Raspberry Pi Pico that will mimic mouse and keyboard input to the USB port it is plugged into. The scripts, written in CircuitPython, are very simple, but you can see how they work easily enough.

This seems ideal for something like a Stream Deck, which can control something like OBS when doing video broadcasting. Alternatively, you can do what Novaspirit Tech did and plug the Pico into your mobile phone to automate an Android game. Very clever stuff. You can read how he did it by visiting his blog.

Create a soil moisture sensor with a Raspberry Pi Pico and an LED ring

Andy Warburton has blogged this great project with the Raspberry Pi Pico. He has used a SparkFun Soil Moisture sensor to detect moisture levels inside a plant pot. This is then wired up to the Pico, using one of the analog inputs to take the readings. The readings are then briefly analysed and a colour indicator on a Neopixel circle is then activated. It’s a great proof-of-concept for using the analog capabilities of the Pico and Andy’s blog post is well worth a read and it includes the code for you to get going.

How to develop for the Raspberry Pi Pico on a Mac

Tony Smith, aka smittytone, has written two articles that are well worth a read if you’re trying to develop for the new Raspberry Pi Pico with a Mac.

The first is how to program a Pico in C and the second is to do with debugging the Pico with another Pico and a Mac.

Having a range of development platform options for the Pico is, I think, key to making it a success in the Pi community. So, thanks to Tony for working it all out!

Use the screen on the Pimoroni Pico Explorer from CircuitPython

A little while ago, on Twitter, I bemoaned that CircuitPython didn’t “just work” with the Pimoroni Pico Explorer. On this board, there is a little LCD screen, an ST7789. Theoretically, a CircuitPython library exists for it, but it didn’t quite work when I tried it with the Pico Explorer. On Twitter, @wildestpixel picked up on this and we found that we were trying to do the same thing. On Saturday, they announced that they’d managed it. So, I thought I’d write up how to do it in detail, based on their code which is based itself on this blog post that explains how to use CircuitPython to drive a generic ST7789.

Huge thanks to @wildestpixel for doing the legwork on this! Follow them on Twitter!

Tutorial

As before, I’m using Windows, so if you’re using a Mac or Linux, you will have a slightly different experience getting the firmware on the Pico.

Download and install CircuitPython

The first thing to do is to download the very latest CircuitPython from Adafruit.

This will give you a .uf2 file, which is the CircuitPython firmware for the Pico. We then need to flash the firmware to the Pico.

With your Pico unplugged, hold down BOOTSEL and then plug it in. This will give you a folder RPI-RP2. Drag-and-drop the uf2 file onto the Pico. This will cause it to reboot – voila, the firmware is installed. You will get a new drive called CIRCUITPY on your machine. This is the Pico as a “removable drive”.

Get an editor

Next, download the Mu editor. You could also use Thonny, BUT Mu is what Adafruit recommends, so that’s what we’ll go for. Once downloaded, install it and run it.

Download the Adafruit libraries and install the right one on the Pico

Head over to circuitpython.org and download the latest Bundle. This gets you all the Adafruit libraries.

Unzip it. We need two things from the ‘lib’ folder that you’ve just unzipped.

  1. The file from the lib folder called adafruit_st7789.mpy. Copy this file and paste it directly into the lib folder on the CIRCUITPY device.
  2. The entire folder called adafruit_display_text. Copy this folder and paste it into the lib folder on CIRCUITPY so that it is a sub-folder.

That’s all you need to do to use the library in question.

Put the code on the Pico

Go to Wildest Pixel’s Gist on GitHub and copy-and-paste the code into Mu. Save it as ‘code.py’ on the CIRCUITPY drive.

This should make the Pico reboot and you should see something on the screen (as pictured above).

What next?

Well, the next thing to do will be to change the code so that it displays what I want it to. Then, I can integrate the buttons, maybe to rotate the screen to start with, as the code is in the script to do that. After that, I guess I will be taking a look at the CircuitPython documentation over on readthedocs.

 

Let me know in the comments if you have any trouble!