Raspberry Pi Pico
11x7 LED Matrix Breakout

The 11x7 LED matrix breakout is a nice little board. It is part of a range of lovely Pimoroni products called the 'breakout garden'. Pimoroni have built a library into their own MicroPython build. I thought I'd have a quick go and see how easy it was to use the same code base I had for the Scroll Pack.

I am using a breadboard adapter that Pimoroni have for these boards. This means that nothing had to be soldered to get this working.

Pico Circuit

A minor adjustment to the library I used for the Scroll Pack. Again, I have added line breaks to the font definition to make this fit the page. Remove the line breaks when you copy this. This is the library that I saved as scroll11x7.py.

from time import sleep_ms

font = bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x5f\x00\x00\x00\x07\x00\x07\x00\x14\x7f

_f = 0
_b = bytearray(145)

class Matrix:   
    def __init__(self, i2c):
        self.i2c = i2c
        self._w(253, 11)
        self._w(10, 0)
        self._w(10, 1)
        self._w(0, 0)
        self._w(6, 0)
        for bank in [1,0]:
            self._w(253, bank)
            self._w([0] + [255] * 17)
    def _w(self, *args):
        if len(args) == 1: args = args[0]
        self.i2c.writeto(117, bytes(args))

    def clear(self):
        global _b
        del _b
        _b = bytearray(145)
    def fill(self, v):
        global _b
        del _b
        _b = bytearray([v]*145)
    def show(self):
        global _f
        _f = not _f
        self._w(253, _f)
        _b[0] = 36
        self._w(253, 11)
        self._w(1, _f)

    def set_pixel(self,col, row, brightness):
        global _b
        _b[self._pixel_addr(col, row)] = brightness

    def get_pixel(self, col, row):
        global _b
        return _b[self._pixel_addr(col, row)]
    def _pixel_addr(self, x, y):
        return (x << 4) - y + 1 + (6 if x <= 5 else -82)
    def scroll(self, txt, delay, v):
        global _b
        msg = bytearray([0]*11)
        for c in txt:
            msg += bytearray(b'\x00')
            msg += font[(ord(c)-32)*5:(ord(c)-32)*5+5]
            msg += bytearray(b'\x00')
        msg += bytearray([0]*11)
        for i in range(len(msg)-11):
            m = msg[i:i+11]
            for y in range(7):
                for x in range(11):
                    if m[x]>>y & 1:

I connected up the pins of the adapter so that the 3V and GND pins went where you would expect. I have connected SDA to GP4 and SCL to GP5,

from machine import Pin, I2C
from time import sleep
from scroll11x7 import Matrix

i2c=I2C(0,sda=Pin(4), scl=Pin(5))

display = Matrix(i2c)

# test pixel writing
for y in range(7):
    for x in range(11):

while True:
    display.scroll("Scrolling again.", 50, 128)