{"id":20904,"date":"2021-03-07T18:15:46","date_gmt":"2021-03-07T17:15:46","guid":{"rendered":"https:\/\/www.recantha.co.uk\/blog\/?p=20904"},"modified":"2021-03-09T14:46:15","modified_gmt":"2021-03-09T13:46:15","slug":"modifying-an-adafruit-circuitpython-library-to-support-the-pimoroni-11x7-led-matrix-breakout-on-the-raspberry-pi-pico","status":"publish","type":"post","link":"https:\/\/www.recantha.co.uk\/blog\/?p=20904","title":{"rendered":"Modifying an Adafruit CircuitPython library to support the Pimoroni 11&#215;7 LED Matrix Breakout on the Raspberry Pi Pico"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-20905\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=560%2C560&#038;ssl=1\" alt=\"\" width=\"560\" height=\"560\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=560%2C560&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=260%2C260&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?resize=160%2C160&amp;ssl=1 160w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>At the moment, I am trying to combine several different products &#8211; sensors, displays &#8211; into a project for the Raspberry Pi Pico. One of them is the <a href=\"https:\/\/shop.pimoroni.com\/products\/11x7-led-matrix-breakout\" target=\"_blank\" rel=\"noopener\">Breakout Garden 11&#215;7 Matrix from Pimoroni<\/a>. I&#8217;ve chosen to use CircuitPython as there are a\u00a0<em>lot<\/em> of libraries available from Adafruit. One of those available is the <a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_IS31FL3731\" target=\"_blank\" rel=\"noopener\">IS31FL3731<\/a> library which supports a variety of products (use the link to see which ones)\u00a0<strong>but<\/strong> not the one I needed it to. I decided to see how difficult it was to add support for the 11&#215;7 Matrix to it. Here is what I did to do just that.<\/p>\n<p><strong>Addendum<\/strong><\/p>\n<p><em>I&#8217;ve since been told (by David Glaude) that there are easier ways to do this (such as doing a library in regular, non-compiled Python). Of course, I obviously didn&#8217;t find this way, and I think that compiling to .mpy saves some space on the Pico. There&#8217;s also a pre-compiled version of mpy-cross for Windows that avoids all the Ubuntu\/WSL stuff. However, having a Linux shell available on Windows does give me other advantages, so &#8220;swings-and-roundabouts&#8221;&#8230;<\/em><\/p>\n<h2>MPY files<\/h2>\n<p>The first thing I realised was that the <a href=\"https:\/\/circuitpython.org\/libraries\" target=\"_blank\" rel=\"noopener\">library files provided by Adafruit<\/a> are pre-built as .mpy files &#8211; compiled Python. So, I would need to figure out how to build from the source Python .py file into .mpy. Fortunately, being the nice people they are, Adafruit provide <a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_IS31FL3731\" target=\"_blank\" rel=\"noopener\">the source code file<\/a> so that it is modifiable. So&#8230; How do I build everything?<\/p>\n<h2>Windows Subsystem for Linux<\/h2>\n<p>I&#8217;m using Windows at the moment (for better or worse) so there are some hoops to jump through! I found <a href=\"https:\/\/forums.adafruit.com\/viewtopic.php?f=8&amp;t=166738\" target=\"_blank\" rel=\"noopener\">this thread on a Forum<\/a> which contained some hints and mentioned something called the WSL &#8211; the Windows Subsystem for Linux &#8211; which gives you a Linux terminal prompt and lets you do things in a &#8220;Linux-y&#8221; way.<\/p>\n<p><a href=\"https:\/\/learn.adafruit.com\/building-circuitpython\/windows-subsystem-for-linux\" target=\"_blank\" rel=\"noopener\">Adafruit provides instructions for installing the WSL here<\/a> (which I won&#8217;t duplicate, but suffice to say, you use Windows Features to add it and then install the Ubuntu app through the Windows Store). Once I&#8217;d installed that and set-up a username for myself, I saw a typical Ubuntu terminal screen.<\/p>\n<p>Then, I needed to install some build tools into the WSL. Again, <a href=\"https:\/\/learn.adafruit.com\/building-circuitpython\/linux#install-build-tools-on-ubuntu-2-2\" target=\"_blank\" rel=\"noopener\">Adafruit provides instructions for installing these<\/a>. The &#8220;meat&#8221; of this is as follows (I added the pip3 install as it wasn&#8217;t there):<\/p>\n<pre><span class=\"pln\">sudo apt update<\/span>\r\n<span class=\"com\"># Try running `make` at the command line. If it's not installed, do:<\/span>\r\n<span class=\"com\"># sudo apt install build-essential<\/span>\r\n<span class=\"pln\">sudo apt install git<\/span>\r\n<span class=\"pln\">sudo apt install gettext\r\n<\/span>sudo apt install python3-pip\r\n<span class=\"pln\">pip3 install huffman<\/span><\/pre>\n<h2>ARM gcc toolchain<\/h2>\n<p>I also needed the &#8220;ARM gcc toolchain&#8221; (which I <em>think<\/em> is the bits and pieces needed to compile for an ARM processor). I&#8217;m going to be using the latest CircuitPython firmware (which is hovering around v6.2 beta-3) so I needed <a href=\"https:\/\/developer.arm.com\/-\/media\/Files\/downloads\/gnu-rm\/10-2020q4\/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2?revision=ca0cbf9c-9de2-491c-ac48-898b5bbc0443&amp;la=en&amp;hash=68760A8AE66026BCF99F05AC017A6A50C6FD832A\" target=\"_blank\" rel=\"noopener\">the 10-2020-q4-major version<\/a>. Now, I should probably have used curl or wget to get the file straight into WSL, but I didn&#8217;t, so it was then downloaded to my Windows Downloads folder.<\/p>\n<p>However&#8230; the WSL mounts my C drive in \/mnt, so first I moved the file to the C drive, then copied the file into the Linux area by using:<\/p>\n<pre>mkdir ~\/bin\r\ncp \/mnt\/c\/&lt;filename&gt; ~\/bin\/<\/pre>\n<p>This created a bin folder in my home folder and then copied &lt;filename&gt; into it. To unpack the file I did this:<\/p>\n<pre>cd ~\/bin\r\ntar xvf &lt;filename&gt;<\/pre>\n<p>I now needed to add the path to my ~\/.bash_profile file.<\/p>\n<p>This is easier said than done if you&#8217;re not used to Linux. Hopefully, you are because you&#8217;re reading a Raspberry Pi blog! If you&#8217;re not, take a look at using the Nano editor as I don&#8217;t want to go into that here.<\/p>\n<p>I got the bin folder path from the folder that I just unpacked. This will be something like&#8230;<\/p>\n<pre>\/home\/&lt;user&gt;\/bin\/gcc-arm-none-eabi-10-2020-q4-major\/bin<\/pre>\n<p>I copied that to my clipboard, then edited the ~\/.bash_profile file (which was a new file for me &#8211; make sure you include the full stop if you&#8217;re replicating) and added the following line (which you&#8217;ll need to change to match your own path).<\/p>\n<pre>export PATH=\/home\/recantha\/bin\/gcc-arm-none-eabi-10-2020-q4-major\/bin:$PATH<\/pre>\n<p>I logged out from the terminal (CTRL-D normally does it) and then opened the Ubuntu terminal again to type:<\/p>\n<pre>which arm-none-eabi-gcc<\/pre>\n<p>This returned a path (as opposed to an empty line). If you&#8217;re following me and it returns an empty line, you&#8217;ve done something wrong and you should retrace your steps. You probably did the export command wrong in .bash_profile or you didn&#8217;t logout and log back in again!<\/p>\n<p>I made sure I was in my home directory before going any further by typing:<\/p>\n<pre>cd ~<\/pre>\n<h2>Building the compiler<\/h2>\n<p>I now needed to build the mpy-cross compiler. This is described in <a href=\"https:\/\/learn.adafruit.com\/building-circuitpython\/build-circuitpython\" target=\"_blank\" rel=\"noopener\">this tutorial from Adafruit<\/a>. In short:<\/p>\n<pre><span class=\"pln\">git clone https<\/span><span class=\"pun\">:\/\/<\/span><span class=\"pln\">github<\/span><span class=\"pun\">.<\/span><span class=\"pln\">com<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">adafruit<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">circuitpython<\/span><span class=\"pun\">.<\/span><span class=\"pln\">git<\/span>\r\n<span class=\"pln\">cd circuitpython<\/span>\r\n<span class=\"pln\">git submodule sync <\/span><span class=\"pun\">--<\/span><span class=\"pln\">quiet <\/span><span class=\"pun\">--<\/span><span class=\"pln\">recursive<\/span>\r\n<span class=\"pln\">git submodule update <\/span><span class=\"pun\">--<\/span><span class=\"pln\">init<\/span>\r\n<span class=\"pln\">make <\/span><span class=\"pun\">-<\/span><span class=\"pln\">C mpy<\/span><span class=\"pun\">-<\/span><span class=\"pln\">cross<\/span><\/pre>\n<p>I\u00a0<em>didn&#8217;t<\/em> build CircuitPython itself because I have no need to compile my own CircuitPython firmware (yet!). The last step (building mpy-cross) took a little while.<\/p>\n<h2>Compiling py to mpy<\/h2>\n<p>The next thing to do was to compile a .py file into .mpy just to see if it worked. To do this, I needed to know the path to the mpy-cross executable. This was, in my case: ~\/circuitpython\/mpy-cross\/mpy-cross<\/p>\n<p>I decided to fork from <a href=\"https:\/\/github.com\/adafruit\/Adafruit_CircuitPython_IS31FL3731\/\" target=\"_blank\" rel=\"noopener\">the Adafruit library<\/a> to my own repository. That way, if I wanted to, I could then do a pull request to Adafruit to incorporate the new code. Whether I do this or not depends on me being brave! \ud83d\ude42 So, I clicked the fork button and replicated the code to <a href=\"https:\/\/github.com\/recantha\/Adafruit_CircuitPython_IS31FL3731\" target=\"_blank\" rel=\"noopener\">my own repo<\/a>.<\/p>\n<p>The next thing to do was to get that repository into the WSL environment on my Windows machine. I did this by:<\/p>\n<pre>git clone https:\/\/github.com\/recantha\/Adafruit_CircuitPython_IS31FL3731<\/pre>\n<p>I then went into the directory that I had cloned and used mpy-cross to compile the Python file into .mpy:<\/p>\n<pre>cd Adafruit_CircuitPython_IS31FL3731\r\n~\/circuitpython\/mpy-cross\/mpy-cross adafruit_is31fl3731.py<\/pre>\n<p>To my surprise, it worked without errors!<\/p>\n<h2>Connecting the Pico to WSL<\/h2>\n<p>Now, how do I get that library file onto the Pico. I could, of course, copy it from the Linux area back into the C: drive and do it that way, but there was an easier method.<\/p>\n<p>First of all, I identified that my Pico was mounted onto Windows using E:.<\/p>\n<p>So, I did the following to create a &#8220;mount point&#8221; and then mounted the Pico (the E drive) to it:<\/p>\n<pre>sudo mkdir \/mnt\/e\r\nsudo mount -t drvfs E: \/mnt\/e\r\nls \/mnt\/e<\/pre>\n<p>This last command <em>should<\/em> list the files on the E: drive (one of which\u00a0<em>should<\/em>, if you&#8217;ve already uploaded code to the Pico, be code.py).<\/p>\n<p>I knew I needed to put the mpy file into the lib folder on the Pico, so I did this:<\/p>\n<pre>cp ~\/Adafruit_CircuitPython_IS31FL3731\/adafruit_is31fl3731.mpy \/mnt\/e\/lib\/<\/pre>\n<h2>Running the code<\/h2>\n<p>I had (and still have) no idea how to use WSL as a programming environment for the Pico, so I swapped back to Windows and ran Mu. I uploaded my program to the Pico which used the IS31* library. I received the same &#8220;Unsupported operation&#8221; error that I got earlier, so all good so far. Now&#8230; let&#8217;s see about modifying that code&#8230;<\/p>\n<h2>Side note<\/h2>\n<p><em>Okay, so what actually happened is that Mu stopped showing me the REPL. So I had to download the <a href=\"https:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener\">PuTTY<\/a> terminal software package and connect to it separately to see the output&#8230;<\/em><\/p>\n<p><em>Now, back to our scheduled programme&#8230;<\/em><\/p>\n<h2>Getting some output<\/h2>\n<p>So, what does &#8220;Unsupported operation&#8221; actually mean? Well, I guessed that as I was running the following on the Pico:<\/p>\n<pre>i2c = busio.I2C(scl=board.GP21, sda=board.GP20, frequency=100000)\r\ndisplay = adafruit_is31fl3731.Matrix(i2c)<\/pre>\n<p>and getting that error around the following line:<\/p>\n<pre>File \"adafruit_is31fl3731.py\", line 102, in _i2c_write_reg<\/pre>\n<p>&#8230; that I was attempting to write over I2C to something I couldn&#8217;t. So, let&#8217;s look at the Matrix code&#8230; The Matrix code uses I2C address 0x74 as its default. This is wrong. On the back of the 11&#215;7 module, it says:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-20912\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=560%2C560&#038;ssl=1\" alt=\"\" width=\"560\" height=\"560\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=560%2C560&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=260%2C260&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_3_of_4_1024x1024.jpg?resize=160%2C160&amp;ssl=1 160w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>&#8230;0x75 or 0x77. Now, I haven&#8217;t altered the board by cutting the trace at the top-right, so we&#8217;re going to assume it&#8217;s the 0x75 address. This is different, obviously, to the default that the library is using, so the error appears to be that I&#8217;m trying to write to an I2C address that isn&#8217;t there. Fair enough. Inside the library code, it looks like the Matrix class init() function accepts an address parameter, so let&#8217;s try using that and see what we get&#8230;<\/p>\n<pre>display = adafruit_is31fl3731.Matrix(i2c, address=0x75)<\/pre>\n<p>I saved it and this time I received no error message. Excellent. Now, I know that the Matrix class has a hardcoded width of 16 and height of 9, and this is, of course, different to the Breakout Garden module&#8217;s 11&#215;7 dimensions. So, we <em>will<\/em> have problems with getting the pixels in the right place, but let&#8217;s add to the CircuitPython code on the Pico the following:<\/p>\n<pre>display.fill(127)<\/pre>\n<p>This ought to display a solid colour&#8230; Save it&#8230; Check the REPL (using PuTTY, now &#8211; see above). Ta-da!<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-20913\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=560%2C401&#038;ssl=1\" alt=\"\" width=\"560\" height=\"401\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?w=1200&amp;ssl=1 1200w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=300%2C215&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=1024%2C733&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=768%2C550&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=560%2C401&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=260%2C186&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?resize=160%2C115&amp;ssl=1 160w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210307_153003804_crop.jpg?w=1120&amp;ssl=1 1120w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>It worked! Excellent. Now, to try and get some text scrolling across&#8230;<\/p>\n<p>Unfortunately, the <a href=\"https:\/\/learn.adafruit.com\/i31fl3731-16x9-charliplexed-pwm-led-driver\/python-examples\" target=\"_blank\" rel=\"noopener\">examples from Adafruit<\/a> for scrolling text and displaying images require PIL (Python Image Library). I read somewhere that PIL doesn&#8217;t work in CircuitPython, just in normal Python. Umm&#8230; Okay, let&#8217;s leave that for now.<\/p>\n<p>I decided, instead, to just try looping through each pixel in order as a test. This is where knowing a little bit about the Pimoroni product and where they keep their code comes in handy.<\/p>\n<h2>Looking at the Pimoroni library<\/h2>\n<p><a href=\"https:\/\/github.com\/pimoroni\/matrix11x7-python\/blob\/master\/library\/matrix11x7\/__init__.py\" target=\"_blank\" rel=\"noopener\">The Pimoroni init() function for their 11&#215;7 matrix is here<\/a>. Now, this is written in normal Python, not CircuitPython, not even MicroPython, so I&#8217;ve tried to do a halfway house between their code and the Adafruit library.<\/p>\n<p>I did a bit of looking around and found that the existing CircuitPython library supports <a href=\"https:\/\/shop.pimoroni.com\/products\/scroll-phat-hd\" target=\"_blank\" rel=\"noopener\">the Scroll pHAT HD<\/a>. This is 17&#215;7, so not far off. So, I started with that function, copied it and pasted it back into the Adafruit library, changing the class name to Matrix11x7. I also added a new __init__() function that would set the 0x75 address by default.<\/p>\n<p>Now, to re-compile using myp-cross again and upload&#8230; All good so far.<\/p>\n<p>I then changed the CircuitPython code on the Pico to use Matrix11x7():<\/p>\n<pre>display = adafruit_is31fl3731.Matrix11x7(i2c)<\/pre>\n<p>It worked again &#8211; this must mean that it is using my new, modified library code! Exciting!<\/p>\n<h2>Getting the Matrix right<\/h2>\n<p>I added some Pico code to display pixels one at a time:<\/p>\n<pre>for y in range(7):\r\n    for x in range(11):\r\n        display.pixel(x, y, 100)\r\n        time.sleep(0.1)\r\n        display.fill(0)<\/pre>\n<p>What this code\u00a0<em>should<\/em> do is to put a single pixel on the display, left to right, bottom to top and do it for every LED on the display. As you can see&#8230;<\/p>\n<p><iframe loading=\"lazy\" title=\"11x7 matrix with Circuit Python. Test 1\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/2PDrbxIzhVE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>it didn&#8217;t\u00a0<em>quite<\/em> work (although, getting the ranges wrong initially, and for this video, didn&#8217;t help!) so I knew I needed to do some translation in the library. This is the code I had to work with, from a different class:<\/p>\n<pre>def pixel_addr(x, y):\r\n    if x &lt;= 8:\r\n        x = 8 - x\r\n        y = 6 - y\r\n    else:\r\n        x = x - 8\r\n        y = y - 8\r\n\r\n    return x * 16 + y<\/pre>\n<p>I knew, just by looking at it, that it wasn&#8217;t quite right. I love maths. Honest I do&#8230;<\/p>\n<p>Then, I wondered: have Pimoroni already done the hard work for me? And indeed they had! If you look at <a href=\"https:\/\/github.com\/pimoroni\/matrix11x7-python\/blob\/master\/library\/matrix11x7\/__init__.py\" target=\"_blank\" rel=\"noopener\">their normal Python library for it<\/a>, you&#8217;ll see that their _pixel_addr() function has a mapping and some calculations:<\/p>\n<pre>mapping = [\r\n    6, 22, 38, 54, 70, 86, 14, 30, 46, 62, 78,\r\n    5, 21, 37, 53, 69, 85, 13, 29, 45, 61, 77,\r\n    4, 20, 36, 52, 68, 84, 12, 28, 44, 60, 76,\r\n    3, 19, 35, 51, 67, 83, 11, 27, 43, 59, 75,\r\n    2, 18, 34, 50, 66, 82, 10, 26, 42, 58, 74,\r\n    1, 17, 33, 49, 65, 81, 9, 25, 41, 57, 73,\r\n    0, 16, 32, 48, 64, 80, 8, 24, 40, 56, 72\r\n]\r\n\r\ny = self.height - 1 - y\r\nreturn mapping[(y * self.width) + x]<\/pre>\n<p>This is the &#8220;magic sauce&#8221; (or source! ha-ha&#8230; #tumbleweed) that makes the maths that makes it work. I converted it into something that would work in MicroPython\/CircuitPython and&#8230;<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-20915\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=560%2C289&#038;ssl=1\" alt=\"\" width=\"560\" height=\"289\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?w=1080&amp;ssl=1 1080w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=300%2C155&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=1024%2C529&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=768%2C397&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=560%2C289&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=260%2C134&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/Matrix11x7-final-function.jpg?resize=160%2C83&amp;ssl=1 160w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>Ta-da! A halfway house between Pimoroni&#8217;s code and Adafruit&#8217;s original library. I ran the code again and&#8230;<\/p>\n<p><iframe loading=\"lazy\" title=\"11x7 matrix. Test 2\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/9ZL04M7t1b0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Hooray! A successfuly library mod and upload to the Pico, followed by a successful test of each and every pixel in the correct order.<\/p>\n<p>I&#8217;ll do something about scrolling text later &#8211; this is enough for now!<\/p>\n<h2>Closing thoughts<\/h2>\n<p>I hope this is of some use to somebody &#8211; I know I&#8217;ll need to refer back to it at some point!<\/p>\n<p>If I could manage this, you can too! The toolchain is a little complicated on Windows (I suspect if I&#8217;d have done it using a Raspberry Pi\/native Linux environment it would have been simpler, but you use what you&#8217;ve got!)<\/p>\n<p>I even plucked up the courage to do a Pull Request to merge it into the original Adafruit library!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the moment, I am trying to combine several different products &#8211; sensors, displays &#8211; into a project for the Raspberry Pi Pico. One of them is the Breakout Garden 11&#215;7 Matrix from Pimoroni. I&#8217;ve chosen to use CircuitPython as&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":20905,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Modifying a CircuitPython library to use a Pimoroni product with the Raspberry Pi Pico","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[80,20,39,972,51],"tags":[198,981,151],"class_list":["post-20904","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blinkies","category-gpio-boards","category-programming","category-raspberry-pi-pico","category-tutorials","tag-adafruit","tag-circuitpython","tag-pimoroni"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Modifying an Adafruit CircuitPython library to support the Pimoroni 11x7 LED Matrix Breakout on the Raspberry Pi Pico - Raspberry Pi Pod<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modifying an Adafruit CircuitPython library to support the Pimoroni 11x7 LED Matrix Breakout on the Raspberry Pi Pico - Raspberry Pi Pod\" \/>\n<meta property=\"og:description\" content=\"At the moment, I am trying to combine several different products &#8211; sensors, displays &#8211; into a project for the Raspberry Pi Pico. One of them is the Breakout Garden 11&#215;7 Matrix from Pimoroni. I&#8217;ve chosen to use CircuitPython as&hellip;Read more &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\" \/>\n<meta property=\"og:site_name\" content=\"Raspberry Pi Pod\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/recantha\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-07T17:15:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-09T13:46:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i1.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Horne\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@recantha\" \/>\n<meta name=\"twitter:site\" content=\"@recantha\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Horne\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\"},\"author\":{\"name\":\"Michael Horne\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263\"},\"headline\":\"Modifying an Adafruit CircuitPython library to support the Pimoroni 11&#215;7 LED Matrix Breakout on the Raspberry Pi Pico\",\"datePublished\":\"2021-03-07T17:15:46+00:00\",\"dateModified\":\"2021-03-09T13:46:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\"},\"wordCount\":2015,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1\",\"keywords\":[\"adafruit\",\"CircuitPython\",\"pimoroni\"],\"articleSection\":[\"Blinkies\",\"GPIO boards\",\"Programming\",\"Raspberry Pi Pico\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\",\"name\":\"Modifying an Adafruit CircuitPython library to support the Pimoroni 11x7 LED Matrix Breakout on the Raspberry Pi Pico - Raspberry Pi Pod\",\"isPartOf\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1\",\"datePublished\":\"2021-03-07T17:15:46+00:00\",\"dateModified\":\"2021-03-09T13:46:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.recantha.co.uk\/blog\/?p=20904\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1\",\"width\":1024,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=20904#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.recantha.co.uk\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modifying an Adafruit CircuitPython library to support the Pimoroni 11&#215;7 LED Matrix Breakout on the Raspberry Pi Pico\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#website\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/\",\"name\":\"Raspberry Pi Pod\",\"description\":\"Experiences with the Raspberry Pi micro computer and microcontroller\",\"publisher\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.recantha.co.uk\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\",\"name\":\"Raspberry Pi Pod\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1\",\"width\":800,\"height\":337,\"caption\":\"Raspberry Pi Pod\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/recantha\/\",\"https:\/\/x.com\/recantha\",\"https:\/\/www.linkedin.com\/in\/recantha\/\",\"https:\/\/www.youtube.com\/channel\/UCK4F9blabxzmk8Inzhs8tpg\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263\",\"name\":\"Michael Horne\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g\",\"caption\":\"Michael Horne\"},\"url\":\"https:\/\/www.recantha.co.uk\/blog\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Modifying an Adafruit CircuitPython library to support the Pimoroni 11x7 LED Matrix Breakout on the Raspberry Pi Pico - Raspberry Pi Pod","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.recantha.co.uk\/blog\/?p=20904","og_locale":"en_US","og_type":"article","og_title":"Modifying an Adafruit CircuitPython library to support the Pimoroni 11x7 LED Matrix Breakout on the Raspberry Pi Pico - Raspberry Pi Pod","og_description":"At the moment, I am trying to combine several different products &#8211; sensors, displays &#8211; into a project for the Raspberry Pi Pico. One of them is the Breakout Garden 11&#215;7 Matrix from Pimoroni. I&#8217;ve chosen to use CircuitPython as&hellip;Read more &rarr;","og_url":"https:\/\/www.recantha.co.uk\/blog\/?p=20904","og_site_name":"Raspberry Pi Pod","article_publisher":"https:\/\/www.facebook.com\/recantha\/","article_published_time":"2021-03-07T17:15:46+00:00","article_modified_time":"2021-03-09T13:46:15+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/i1.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1","type":"image\/jpeg"}],"author":"Michael Horne","twitter_card":"summary_large_image","twitter_creator":"@recantha","twitter_site":"@recantha","twitter_misc":{"Written by":"Michael Horne","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#article","isPartOf":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904"},"author":{"name":"Michael Horne","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263"},"headline":"Modifying an Adafruit CircuitPython library to support the Pimoroni 11&#215;7 LED Matrix Breakout on the Raspberry Pi Pico","datePublished":"2021-03-07T17:15:46+00:00","dateModified":"2021-03-09T13:46:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904"},"wordCount":2015,"commentCount":3,"publisher":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#organization"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1","keywords":["adafruit","CircuitPython","pimoroni"],"articleSection":["Blinkies","GPIO boards","Programming","Raspberry Pi Pico","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.recantha.co.uk\/blog\/?p=20904#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904","url":"https:\/\/www.recantha.co.uk\/blog\/?p=20904","name":"Modifying an Adafruit CircuitPython library to support the Pimoroni 11x7 LED Matrix Breakout on the Raspberry Pi Pico - Raspberry Pi Pod","isPartOf":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1","datePublished":"2021-03-07T17:15:46+00:00","dateModified":"2021-03-09T13:46:15+00:00","breadcrumb":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.recantha.co.uk\/blog\/?p=20904"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#primaryimage","url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1","width":1024,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=20904#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.recantha.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"Modifying an Adafruit CircuitPython library to support the Pimoroni 11&#215;7 LED Matrix Breakout on the Raspberry Pi Pico"}]},{"@type":"WebSite","@id":"https:\/\/www.recantha.co.uk\/blog\/#website","url":"https:\/\/www.recantha.co.uk\/blog\/","name":"Raspberry Pi Pod","description":"Experiences with the Raspberry Pi micro computer and microcontroller","publisher":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.recantha.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.recantha.co.uk\/blog\/#organization","name":"Raspberry Pi Pod","url":"https:\/\/www.recantha.co.uk\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1","width":800,"height":337,"caption":"Raspberry Pi Pod"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/recantha\/","https:\/\/x.com\/recantha","https:\/\/www.linkedin.com\/in\/recantha\/","https:\/\/www.youtube.com\/channel\/UCK4F9blabxzmk8Inzhs8tpg"]},{"@type":"Person","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263","name":"Michael Horne","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g","caption":"Michael Horne"},"url":"https:\/\/www.recantha.co.uk\/blog\/?author=1"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/11x7_matrix_breakout_2_of_4_1024x1024.jpg?fit=1024%2C1024&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2RsaV-5ra","jetpack-related-posts":[{"id":20959,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=20959","url_meta":{"origin":20904,"position":0},"title":"Create a low-res thermal camera with a Raspberry Pi Pico, an AMG8833 sensor and an ILI9341 screen with CircuitPython","author":"Michael Horne","date":"22 March 2021","format":false,"excerpt":"As part of an ongoing Raspberry Pi Pico-based project, I wanted to create a thermal camera. To do this, I first of all went shopping to find what I needed. Here are the two components for this mini project: Adafruit AMG8833 thermal camera breakout (that's The Pi Hut, you can\u2026","rel":"","context":"In &quot;Geeky Techiness&quot;","block_context":{"text":"Geeky Techiness","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=22"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210321_183534893_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210321_183534893_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210321_183534893_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210321_183534893_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/03\/IMG_20210321_183534893_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":20820,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=20820","url_meta":{"origin":20904,"position":1},"title":"Use the screen on the Pimoroni Pico Explorer from CircuitPython","author":"Michael Horne","date":"7 February 2021","format":false,"excerpt":"A little while ago, on Twitter, I bemoaned that CircuitPython didn't \"just work\" with the Pimoroni Pico Explorer. On this board, there is a little LCD screen, an ST7789. Theoretically, a CircuitPython library exists for it, but it didn't quite work when I tried it with the Pico Explorer. On\u2026","rel":"","context":"In &quot;GPIO boards&quot;","block_context":{"text":"GPIO boards","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=20"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/IMG_20210207_130831716_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/IMG_20210207_130831716_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/IMG_20210207_130831716_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/IMG_20210207_130831716_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/IMG_20210207_130831716_HDR_sm.jpg?fit=1200%2C898&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":20762,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=20762","url_meta":{"origin":20904,"position":2},"title":"CircuitPython from Adafruit runs on the Raspberry Pi Pico","author":"Michael Horne","date":"21 January 2021","format":false,"excerpt":"As highlighted by Les Pounder on Twitter and again by 'tannewt' (Scott Shawcroft) on the Raspberry Pi Forums, Adafruit's CircuitPython will run on the Raspberry Pi Pico and, more generally, RP2040 boards, such as Adafruit's upcoming Feather 2040. According to this post on the Forum you just follow these instructions:\u2026","rel":"","context":"In &quot;Announcements&quot;","block_context":{"text":"Announcements","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=952"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/01\/EsPzY45XAAAtSgK.jpeg?fit=1094%2C488&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/01\/EsPzY45XAAAtSgK.jpeg?fit=1094%2C488&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/01\/EsPzY45XAAAtSgK.jpeg?fit=1094%2C488&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/01\/EsPzY45XAAAtSgK.jpeg?fit=1094%2C488&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/01\/EsPzY45XAAAtSgK.jpeg?fit=1094%2C488&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":20875,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=20875","url_meta":{"origin":20904,"position":3},"title":"Drive servos, steppers, DC motors and solenoids with the Raspberry Pi Pico and CircuitPython with this great guide from Adafruit","author":"Michael Horne","date":"18 February 2021","format":false,"excerpt":"Adafruit have produced some exceptional tutorials\/guides over the years and it appears that they are doing a sterling job on new guides for the Raspberry Pi Pico. Their latest guide shows you to how to hook up a Raspberry Pi Pico to various electronic components to drive servos, stepper motors,\u2026","rel":"","context":"In &quot;Raspberry Pi Pico&quot;","block_context":{"text":"Raspberry Pi Pico","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=972"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/picopartyboard_c.jpg?fit=640%2C480&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/picopartyboard_c.jpg?fit=640%2C480&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/picopartyboard_c.jpg?fit=640%2C480&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":20803,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=20803","url_meta":{"origin":20904,"position":4},"title":"Use Adafruit&#8217;s CircuitPython on the Raspberry Pi Pico","author":"Michael Horne","date":"6 February 2021","format":false,"excerpt":"At the start of the Raspberry Pi Pico launch, it was only possible to program it in either C\/C++ or MicroPython. A few languages are beginning to make an appearance now, including the quite exciting prospect of Rust running on the board. Today, I'm highlighting Adafruit's CircuitPython. It is similar,\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=39"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/CircuitPython_Repo_header_logo.png?fit=1000%2C380&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/CircuitPython_Repo_header_logo.png?fit=1000%2C380&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/CircuitPython_Repo_header_logo.png?fit=1000%2C380&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/02\/CircuitPython_Repo_header_logo.png?fit=1000%2C380&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":21011,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=21011","url_meta":{"origin":20904,"position":5},"title":"Taking the Cytron Maker Pi Pico out for a spin with the Raspberry Pi Pico","author":"Michael Horne","date":"17 April 2021","format":false,"excerpt":"Tony Goodhew has been in touch about some experiments he has run on the new, low-cost Maker Pi Pico from Cytron. TL;DR - here's the Instructable. In the UK, the Maker Pi Pico is available from The Pi Hut (also as a version without the Pico pre-soldered, but with header\u2026","rel":"","context":"In &quot;Geeky Techiness&quot;","block_context":{"text":"Geeky Techiness","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=22"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/04\/FY1JLWQKNG1CJTD.jpg?fit=1024%2C456&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/04\/FY1JLWQKNG1CJTD.jpg?fit=1024%2C456&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/04\/FY1JLWQKNG1CJTD.jpg?fit=1024%2C456&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2021\/04\/FY1JLWQKNG1CJTD.jpg?fit=1024%2C456&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/20904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20904"}],"version-history":[{"count":5,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/20904\/revisions"}],"predecessor-version":[{"id":20919,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/20904\/revisions\/20919"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/media\/20905"}],"wp:attachment":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}