in , , , ,

Virtual Minecraft birthday cake

- Werbung -
Reading Time: 2 minutes

Virtualising baked goods

While something like this could be in some way achieved in Minecraft Raspberry Pi Edition, that was not why a Raspberry Pi was used.

“Raspberry Pi provided an easy way to interface with the analogue-to-digital converters needed to read the wind turbine voltages,” Stephen says. “Along with sufficient computing power to serve a web application from within the cake itself, using Raspberry Pi enabled me use the same software architecture (Python, Flask, HTML) as I have used professionally. Sourcing the right HAT to measure nine voltages was very easy.“

- Werbung -
- Werbung -

Blowing on the wind turbines generates a small amount of voltage, enough to be detected as a change using an ADC.

The virtual cake instead uses looping video overlaid with candle GIFs served via a web app in a clever way, as Stephen explains:

“The application uses Flask to serve a web page which any device on the local network can access… a JavaScript loop is used to repeatedly send a POST request to the web server asking for the voltage from one of nine analogue-to-digital converters (the ADC board can support up to 16 candles). The code to interface with the ADCs and reply to the POST requests is written in Python and utilises the Flask and gpiozero libraries. All the code is available on GitHub.”

Proof in the dessert

Despite the best efforts of developers, sometimes an interface is not always clear to the user – especially when they’ve just turned nine.

The guests quickly figured out what they had to do to blow out the candles

- Werbung -

“I was slightly nervous that the children would find it too abstract, but they worked it out pretty quickly,” Stephen mentions. “They saw the connection between the plastic wind turbines on the cake and the candles on the screen, and worked out that you could turn the on-screen candles off by blowing on the wind turbines. There was much laughter and smiles.

The children were also very pleased to discover that there was actual cake underneath it all.”
If only there were cake underneath every interactive Raspberry Pi project.

There is space under the model cake for the electronics and the real cake

- Werbung -

Report

- Werbung -

What do you think?

Schreibe einen Kommentar