Matrix 11x7 - where to start

I’m just not sure where to begin. I’m new to Python, new to electronics in general.

I bought several Pimoroni devices recently (Blinkt, LED shim, Matrix 11x7) and I’m working out how to make them do things. I’ve figured out the dir() function, but that doesn’t give much detail. Where should I be looking to figure out what I can do and how?

Beyond just expanding my understanding, the short term goal is to use one of these to illuminate the interior of a birdhouse that I have set up with a camera under MotionEye.

Any help is appreciated, thanks.

If you go to the product page for a device, like say the LED Shim. There is usually a link to the python library

On that page there is a folder with examples Those same examples should be on your Pi in Pimoroni folder once you run the installer.

And if you go down to the bottom of the GitHub page there often times are a list to the function
reference. That will be the python commands you’ll want to know about.

http://docs.pimoroni.com/ledshim/

Thanks - I missed those documentation pages. The Matrix 11x7 display doesn’t seem to have a similar page - is there anything elsewhere?

If its the 11x7 breakout garden the examples are here,

Unfortunately I don’t see a function reference. Its a little more work but you can usually figure those out from the examples. You just have to try different things to see what works and what doesn’t.

So are you saying that those examples cover every command that there is for this library? That is, if it isn’t used in the examples there aren’t any more? Like the examples don’t cover how to set the I2C address and the board is capable of running at 0x75 or 0x77 but how do you change it?

I believe you change
matrix11x7 = Matrix11x7()
to
matrix11x7 = Matrix11x7(77)
Not 100% sure
If you had two it would be something like
matrix1 = Matrix11x7(75)
matrix2 = Matrix11x7(77)

Thanks but it is not that.
Neither matrix11x7 = Matrix11x7(77) or
matrix11x7 = Matrix11x7(0x77)
work, they both raised a run time error:-

raise RuntimeError(‘i2c transport must implement: “{}”’.format(attr))
RuntimeError: i2c transport must implement: “read_byte_data”

Where as just using matrix11x7 = Matrix11x7() with the link cut on the martix returned the expected:-

OSError: [Errno 121] Remote I/O error

Phil @gadgetoid likely knows how it needs to be done. Grasping at straws a bit but try x77.
matrix11x7 = Matrix11x7(x77)

I found it. It is actually
matrix11x7 = Matrix11x7(i2c_address = 0x77)
The other functions of this library can be examined by looking in the file:-

matrix11x7-python-master/library/matrix11x7/__init__.py matrix11x7 = Matrix11x7(x77)
Their parameters are explained in that file as well.

Cool, well done. I’ll have to go have a look see at that.

A point on the I2C address. You can set an alternate address by cutting the link to allow the matrix to be used with the LED shim or to allow you to use two Matrix 11X7s. However, it should be possible to set two more addresses by connecting the address pin on the 31FL3731 to either SDA or SCL so allowing four Matrix 11X7s. This should be straightforward as the top pad of the cut link seems to be connected to the address pin.
Anyone know if there is anything wrong with doing this before I try it?

Just went and had a look see myself. Should work as near as I can tell.

AD connected to GND, AD=00;
AD connected to VCC, AD=11;
AD connected to SCL, AD=01;
AD connected to SDA, AD=10;

Yes it works, i have tested this and get:-

no link cut so address line is connected SCL - I2C address 0x75 - clash with Shim
link cut so address line is connected Vcc - I2C address 0x77
link cut and solder a wire between the top pad and Gnd - I2C address 0x74
link cut and solder a wire between the top pad and SDA - I2C address 0x76

Seeing as the normal use of the LED Shim might prevent the matrix being used at the same time then you can use four Matrix displays at the same time.

Nice, will have to try and remeber that for future reference.

Nice, will have to try and remember that for future reference.

Well it might just appear in the December issue of the MagPi. ;)

Insert big thumbs up smiley here. =)