Pico RGB Keypad Base as a USB HID device - SOLVED

Ok, I’ve figured it out. Here goes…

Instructions to get this board working with CircuitPython:

  1. Download latest release (or lastest stable) from Pico Download .
  2. Copy the UF2 file to the Pico after holding down the onboard button at boot to mount as a USB device
  3. The Pico reboots automatically.

Note for the following instructions that unlike the MicroPython UF2 where to copy files to the Pico you must boot it with the button held down you can just connect it to copy files (providing you select to mount when the option appears).

  1. Head on over to wildestpixel on Github and copy the code from Raspberry Pi Pico & Pimoroni RGB Keypad HID in Circuitpython 6.2+ · GitHub to the Pico and run.

  2. It’ll fail complaining that importing adafruit_dotstar just isn’t cricket.

  3. To fix this and the same regarding adafruit_hid head on over to GitHub - adafruit/Adafruit_CircuitPython_Bundle: A bundle of useful CircuitPython libraries ready to use from the filesystem. and then to the latest release.

  4. It took me a couple of goes but I worked out that even though the instructions say that as I am using CircuitPython 6.x I should download the 6.x bundle that this is not true.
    This is because the named 6.x bundle is for Micropython (hmm… I wonder if this means I coudl get the keypad working with Micropython after-all… I’ll try that).
    Download the non-6.x non-examples bundle. As of today this is adafruit-circuitpython-bundle-py-20210213.zip .

  5. Now, this is one heck of a bundle of libraries (thanks Adafruit, you’re awesome!) However, we just need:
    lib/adafruit_dotstar.py
    lib/adafruit_hid directory and all there-in.

  6. Create a lib directory on your Pico and copy the above there. Note if you drag and drop from the zip file it’ll create a dated adafruit directory into which it places the libs. To avoid this I extracted to Documents on my Pi 4 then copied over just what I needed.

  7. This is important: in Thonny create a NEW blank document.

  8. Run the code you downloaded from wildestpixel and press a button, any button. You’ll see the key light up AND text written out to the blank doc. That’s why you don’t want to press buttons when you have Thonny showing your code as the text will get inserted there-in whenever a button is pressed.

Hope that helps. Any problems, do say.