We use cookies to ensure that we give you the best experience on our websites. By continuing to visit
this site you agree to our use of cookies.
Read our cookie policy.
8x8 LED Matrix Halloween Jack-o'-lantern / Pumpkin with a Pico
Here we update our 2015 Raspberry Pi Halloween Jack-o'-lantern / Pumpkin project to work with an RP2040 Raspberry Pi Pico, although it should work with any MicroPython device.
Clive (an old friend our Halloween Pumpkin) has given years of service and fun. Tethered to the wall or charger it's time to set this project free and give it an update.
It was always a chore to set up every year and set a startup script to run the Python code on booting up. With a microcontroller we should see those eyes lighting up almost instantaneously. We'll let you know what you need, how to put it together, give you the code, and show you how to customise everything to your heart's content.
If you are using the HT16K33 version you just need to connect up the following
3v3 from the microcontroller VCC on your matrix
GND to GND
GPIO 5 to SCL
GPIO 4 to SDA
You can change the pins but will need to change those in the code too which is trivial.
#i2c configclock_pin =5data_pin =4bus =0
You also need to let the code in main.py know what driver you are using
use_max7219 =Falseuse_i2c =True
If you don't know the address of each then it should print that in the console when you run the code, then you need to set those addresses in main.py. Below is our setup but replace with your own. Any problems try some values it's usually around 0x70, 0x71, 0x72...
i2c_addr_left =0x70i2c_addr_right =0x72
You will also need to change the address of one of your devices by shorting the contacts on the back.
Everything can be customised and we didn't spent a lot of time creating the sprites and animations so would love to see what you do with it creatively.
Drop us a pull request to add your sprites and animations, and we can share them with everyone.
You can use our handy online matrix tool to design new 8x8 sprite designs and it will give you a list of HEX numbers for your code.
If you take a look at the matrix_fonts.py file the fonts are stored in variables. Check our the variable called eyes which is a python dictionary, below is a little sample.
Each sprite has a key followed by an array of 8 hex numbers. Just add a new one, write your own key and add the numbers from the online tool. Below we added a new sprite called 'new' which is just a diagonal line.
Animations are stored in a JSON file called eyes_ani.json and you can change these too. We have picked out 'stareAndBlink' you can copy this, rename it and use it as a template for your new custom animation.