Open the file in NotePad

This now needs a bit of editing:

Copy the block of code starting const and paste into the code under the buffer definition in Thonny.

Delete the semi colon at the end. Change the braces {} to brackets ()

Find and replace ‘ , 0’ ( — comma space zero) with

Edit the start of each line and replace the initial 0 with a

Delete the commas from the end of each line.

Insert b” after the opening bracket and “ before the closing bracket.

Insert bytearray between the = and the bracket

Delete the newlines to make a single very long line starting:

buffer4 = bytearray(b”x00x ………… “)

Carefully compare the syntax with the original buffer line. (The original Raspberry code has some ‘funny’ characters. The new code should be consistent in its format: xNNx…)

Comment out the original buffer line

Change the line

fb = framebuf.FrameBuffer(buffer3, 32, 32, framebuf.MONO_HLSB)


fb = framebuf.FrameBuffer(buffer4, 32, 32, framebuf.MONO_HLSB)

Save and run your program.

You may need to look at my previous Instructable if you have not yet set up your Pico with an SSD1306 as you will need a special library.

(SSD1306 With Raspberry Pi Pico : 6 Steps (with Pictures) — Instructables )

You can download the final version here:

Leave a Reply