5x5 RGB Matrix Breakout - doing stuff with it

Hello folks, I’m new here.
I recently decided to a) buy a raspberry pi, and b) investigate electronics again.
As a first stage I thought I would look into using the pimoroni 5x5 LED matrix, and as the first step of that I’m using the python library provided.
I’ve previously programmed in a variety of contexts, but not much python, and I’m painfully aware of quite how far away I am from what I want to do electronics-wise. Basically, I’m a beginner. So… you know, caveat emptor.

But anyway, it doesn’t seem like there’s much in the way of discussion or community in using this. The python tutorials mostly work fine, which is something, but there isn’t much else. I thought I’d document my observations and issues, in case anyone is interested.

I’m using a raspberry Pi 400, and Breakout Garden for Raspberry Pi 400. Apparently the pi400 has the connector pins the other way round from other models.

If you’re planning to run a pi400 from the TV, you probably want a longer HDMI cable than the 1m one supplied. My 2m one arrived today, rather belatedly, and I hope it will be a major ergonomic improvement.

The breakout garden has two I2C slots - the LED matrix only works in the right-hand one. I’d assumed it would work in either - (it’s a bus, right?) - but no, it’s two separate sets of pins. I assume you can reconfigure pins somehow, and knowing that is something I’m hoping to find out about, but that will have to wait.

The pi400’s wireless internet is very flakey, and will occasionally stop working until you restart. This is with the pi less than 1m from the router. If you’ve got the garden plugged in, it won’t ever work. Now I use a network cable. If you’re relying on the pi for internet (i.e. to look up how to do stuff with accessories, while you do it), and arn’t right next to your router, this would be a fairly significant issue.

The 5x5 LED matrix works just fine with the examples from the python library… which installed without any trouble.
I’m actually not sure I’ve had all the demos working; I did have some errors but that might have been due to a bad connection and I haven’t been back to check comprehensively.

There doesn’t seem to be much documentation on the 5x5 library. Maybe I’m missing it, in which case it’s a pointer to the documentation which is missing.

When a program finishes, it leaves the LEDs on in whatever state they were. It looks like there’s a call which is meant to switch them off, but it doesn’t. I modified one of the scripts to just blank it.

The python library sets things up for you to address the LEDs as a 2-dimensional array. My current impression is that the axes are wrong though.
Under the surface, it looks like the LEDs are addressed in a line which snakes left and right, rather than a raster-scan.

Getting real-time keyboard information in python is awkward. I’m now using the pygame library, which seems wierd, but perhaps that’s not outside the norm for python.

That’s it for now. I’m hoping to have something more substantial to share at some point.

The GPIO on the Pi 400 is basically tilted back 90 degrees. If you put a Pi 4B etc in front of you with the HDMI etc facing you its as follows
If you lean over the back of the Pi400 with you head down its the same pinout. The down side is if you plug a hat in with a display its facing away from you, all you see is the back side of the Hat. And looking at it from the back its upside down. It is what it is though. Pimoroni’s Pi400 breakouts correct for it. The Pi400 hacker board will have your display facing up and right side up. The Pi400 Breakout garden turns them around to face you too.
Speaking of the Breakout Garden, any i2c breakout should work in any i2c slot. The two slots are wired identically to the Pi’s i2c GPIO pins. I have the Mini i2c and Mini i2c, SPI. It doesn’t matter what slot I put my i2c breakouts in. It sounds like you may have a defective Breakout garden?
I have several breakouts, not the 5x5 matrix though. Actually that’s 5x7 isn’t it?

Did you see this?
ltp305-python/REFERENCE.md at master · pimoroni/ltp305-python (github.com)

Just a couple of observations / comments. I have a lot of similar hardware but haven’t tried exactly what you mention.
I believe the connector pins are the other way round compared to other Pi models, but everything still fits - you just need to know which end to count from. There is an adaptor (Pi 400 Flat HAT Hacker board Flat HAT Hacker – Pimoroni) to make a conventionally orientated and horizontal platform if you want to add HATs and see them properly.
Yes to a longer HDMI. Even 2m is short!
I2C is a bus, and I don’t know how breakout garden handles it. But Pi’s actually have TWO I2C buses - most use ids made of I2C1 on pins 3 and 5, but pins 27 and 28 can be re-assigned to be I2C0 (see I2C at Raspberry Pi GPIO Pinout ). Maybe that’s why your sensor only seems to work in one socket? Maybe try changing your code from import smbus and DEVICE_BUS = 1 to include DEVICE_BUS = 0 instead? Or (from Using the I2C Interface – Raspberry Pi Projects) you can use
sudo i2cdetect -y 0
sudo i2cdetect -y 1
to tell you what devices are connected to each of the 2 buses?
The WiFi of the standard RPi’s is perfectly good. I think I’d have seen complaints if it was as bad as you mention for the Pi 400. My Pi 400 is due to arrive soon (I’ve returned 3 so far due to having the wrong keyboard language - retailer’s fault). Maybe you have bad WiFi, or a hardware fault? I’m sure you know that 2.4GHz is more resilient than 5GHz - but needing to be within a meter is ridiculous. My Pi ZeroW is presently 40m away from the router, through 3 walls and is outdoors running off a Powerbank - no problem connecting over 2.4GHz but the 5GHz is dodgy at that distance. You could try a USB WiFi dongle and turn off the on-board WiFi as a check?

alphanumeric - your reply was written hours before mine, but wasn’t displayed to me until after I’d written. Odd!
Anyway, Loris has the 5x5 RGB LED Matrix 5x5 RGB Matrix Breakout – Pimoroni for which the python library is at GitHub - pimoroni/rgbmatrix5x5-python: Python library for the Pimoroni 5x5 RGB Matrix Breakout That’s completely different to the LTP-305 single colour 5x7 matrix.

Ok it was a 5x5, my bad. I missed the 5x5 LED matrix some how when I scanned the breakouts.
It is a bit of a weird orientation for the GPIO header on the Pi400. I’m not all that fussy for how its laid out if I’m honest.
If you look at the Pi400 from behind the GPIO is as follows
If you put a Pi 4B in front of you with the GPIO closest to you, HDMI jacks facing away opposite you you’ll get the same pinout.
It is orientated differently that’s for sure, but the big thing is its that same pinout as all other Pi’s before it. Like you say, make sure you have Pin 1 on the what your plugging in lined up with pin 1 on the Pi400.

All I can tell you is I have my BME280 plugged into the left most slot on a Breakout Garden i2c Mini. I have an RV3028 in the middle and a LTR-559 in the other slot.
If I run i2cdetect -y 1 all three show up. I can also move one or more to my i2c, SPI mini breakout garden and they show up when running i2cdetect -y 1.
I have always just assumed they were wired in parallel on the one default i2c bus on pins 3 and 5, GPIO 2 and 3.

This prompted me to revisit this, and I can confirm that it does work in the left-most slot as well. Took a bit of wiggling the connections, but it does now work there.
I guess it didn’t work there in the first couple of tries, but did on the right, and I mislead myself with the ‘two I2C buses’ comments from elsewhere.

Well, when it works, it does work really well.
But - I’ve seen a fair number of posts of people complaining about the pi400’s wireless. I think I’m currently restricted to 2 links, so here and here. The thing is, if you google for something, you’re almost guaranteed hits. So it’s hard to know if it’s significant.

To clarify, I don’t think it needs to be within a metre, it’s just that it happens to be, and still doesn’t work reliably - so signal strength probably isn’t the issue. With the garden etc. in it doesn’t work. After switching off and pulling the boards, and restarting I found it does seem to be connect to the router, but unable to actually transfer any information (i.e. can’t connect to open a web page). I rebooted, and it works just fine. It’s not every reboot which fixes it, and after a while it can mysteriously stop working again. When this happens the popup in the comms icon can report the wlan as ‘expired’, but still as associated with the wireless network ID.
It’s not something I’m eager to test exhaustively because I don’t like the repeated insertions and removals, and can easily use a network cable instead. But I think it might be two issues 1) hardware - the electronics hanging off the back interfere with it, and 2) some sort of intermittent software issue.
… okay, I wasn’t meaning to write that much about this topic.

In other news, I feel like I’m getting the hang of the 5x5 LED display. Is there somewhere people post programs they’ve made for devices like that?

The WIFI on my Pi400 seems to be working OK, 2.4 and 5 GHz. My Router is one floor down in my basement, wooden floor.

The pinout for the Breakout Garden i2c hat only shows the one i2c bus in use.
Breakout Garden HAT at Raspberry Pi GPIO Pinout
I have seen one or two other similar posts that one socket didn’t work etc. So far so good for me, all mine are fine as far as I know.