Pimoroni rgb base not working

Hallo!
I recived my Pimoroni rgb base today / with pico), and I cannot get it to work.
I have contact with pico through Tonny ( i,e, I cant print (“Hello world”)-
I followed intructions which files and lib´s I should download but nothing works, Nothing happens when I press the buttons,No lights , nothing!
I tried different example-files but always get errors from Tonny.
I tried both PMK CircuitPython library! and custom MicroPython uf2.
Any ideas where I shall start???
Any help is appriciated.
Mike

You’ll wan’t the CircuitPython utf found here for working with the PMK library, rather than the microPython utf you have linked above

Condensed instructions with links and tips below

you’ll also want the following adafruit libraries
adafruit_dotsar.py from here (controls lighting)
adafruit_hid folder from here (for sending macro keystrokes)
adafruit_midi folder from here (for controlling midi)
all of those and the PMK library (including the examples) go in the /lib folder on the drive labeled CIRCUITPY (your pico RGB Keypad base when connected). copy any PMK example file to the top level of the drive,

!!IMPORTANT!!
Edit the copy to comment out imports for Keybow2040, and remove comment markers for Pico RGB Keypad Base. the defaults are for the keybow
!!IMPORTANT!!

then rename it code.py it should automatically load. (may require a reconnect)

NOTE:
you can find pre-made machinepy versions of the adafruit libraries here (they’re smaller/faster but not human readable) make sure you get the bundle that matches your circuit python version. also if you have both the .py and .mpy versions on your pico, the .py will be used, so make sure to use only the ones you need and delete the others from your pico.

Hallo Nox! Thanx for your help.
I installed the adafruit libraries as you suggested.
There is no mention of of Keybox2040 or Pico RBG in the code.py file .
There is no examples in the PMK library.

Trying to run example : dotstar_simpletest.py , I get this error in thonny:

*****# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries

SPDX-License-Identifier: MIT

import time
import random
import board
import adafruit_dotstar as dotstar

On-board DotStar for boards including Gemma, Trinket, and ItsyBitsy

dots = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)

Using a DotStar Digital LED Strip with 30 LEDs connected to hardware SPI

dots = dotstar.DotStar(board.SCK, board.MOSI, 30, brightness=0.2)

Using a DotStar Digital LED Strip with 30 LEDs connected to digital pins

dots = dotstar.DotStar(board.D6, board.D5, 30, brightness=0.2)

HELPERS

a random color 0 → 192

def random_color():
return random.randrange(0, 7) * 32

MAIN LOOP

n_dots = len(dots)
while True:
# Fill each dot with a random color
for dot in range(n_dots):
dots[dot] = (random_color(), random_color(), random_color())

time.sleep(0.25)

Traceback (most recent call last):
File “”, line 7, in
ImportError: no module named ‘adafruit_dotstar’*****

Where do I go from here?
Mike

If you flash it with the Custom Pimoroni uf2 the Pimoroni demo should work, it did for me. I haven’t tried the 1.19.18 release just yet though.
Release Version 1.19.18 · pimoroni/pimoroni-pico (github.com)

I went with Circuit Python and PMK. I followed this guide.
pimoroni/pmk-circuitpython (github.com)

Make sure Thonny’s interpreter is set to the correct setting in the lower right hand corner.

thanx for help!

I give up,
Error ,error ,error module not found , error no such module , whatever I do.
Thanx anyway for help.

Did you drop the adafruit_dotstar.py file into the lib folder on your CIRCUITPY drive?

Hi!
** Did you drop the adafruit_dotstar.py file into the lib folder on your CIRCUITPY drive?
Yes, no change. I will try again tomorrow!

the PMK examples are in a separate folder in in the first link you posted. each example file includes 2 lines that look like:

from pmk.platform.keybow2040 import Keybow2040 as Hardware         # for Keybow 2040
# from pmk.platform.rgbkeypadbase import RGBKeypadBase as Hardware # for Pico RGB Keypad Base

and need to be changed to

#  from pmk.platform.keybow2040 import Keybow2040 as Hardware         # for Keybow 2040
from pmk.platform.rgbkeypadbase import RGBKeypadBase as Hardware # for Pico RGB Keypad Base

to work for the Pico RGB Keypad Base

example files should always be copied to the top of the folder structure of the device they run on when you try them out, if you run them from a subfolder they may have problems finding the libraries you need (by default python will not look in the folders above it, only below)

ETA:
the easiest way to run examples is (after editing them) replace the code.py file with them, by deleting the old code.py file, copying the example file to where the code.py file was, and renaming the example file code.py

1 Like

HI! Thank you nox! Got it to work efter dabling with folders and subfolders.
I´m learning something new every day…
Mike

glad to hear you got it sorted. The first few projects with microcontroller electronics can be confusing and frustrating, but once you’re past that there’s so many things to play around with.