Pi-On-Pi: Happy Pi Day 2023! (or, 2nd Generation Pi Machine)
Cristiano Monteiro
Solutions Architect @ Dassault Systèmes | Global Solution Provider
Here we go again! It's time, folks! Pi Day is upon us, rejoice!
Today is Pi day (3/14), and I'm publishing once more my salute to this magnificent creature.
Some selected interesting facts about Pi:
By the way, I tried Spock's trick with ChatGPT. It didn't fall for it :(
Last year my humble contribution included a dedicated Pi calculator, which can run indefinitely calculating and scrolling Pi digits through a 4 digits display (https://www.dhirubhai.net/pulse/happy-%CF%80-day-2022-cristiano-monteiro/).
This year I produced a revamped 2nd generation version of it, called Pi-On-Pi! Why? Well, because now I'm using a Raspberry Pi Pico board to calculate Pi.
Raspberry Pi Pico possesses a Dual-core ARM Cortex M0+ running at 133 Mhz, which I put to work, one dedicated to calculating Pi and the other to keep the display updated (felt the need to have a 1 Hz blinking dot to indicate that the machine is working, since the computation will get slower over time, appearing to be frozen. It is not! The machine never gives up!).
On top of it, added a MAX7219 8-digit 7-segment display and a real case, hand cut for the task (not my best job, but...).
The calculation is based on the Simon Plouffe algorithm, which allows calculating individual digits of Pi not knowing the previous digits, and makes use of Fabrice Bellard C code (which is perfect for limited memory machines, like the 264Kb of our Pi Pico board) adapted for this machine purpose.
Here you can see it working in full glory:
And its assembly:
领英推荐
Source code for this project can be found here:
That's all for today, hope you enjoyed it!
References:
Technical Field Coordinator - ICAO
2 年Very good to have Dr Spock reminded in the context!