Linux Format

Build a flashy dice roller with NeoPixels

The £4 Raspberry Pi Pico is powered by a dualcore ARM CPU, and in this tutorial we will learn how to run two threads of MicroPython code independent of each other. The code in core 0 will wait for a user to press a button, and when they do, the code will choose a random number to emulate a D20 die roll. If the user is unsure what to do, a simple instruction will scroll across a seven-segment display, a TM1637 connected to the Raspberry Pi Pico using I2C.

The second core will run a light show, designed to entice the user to try our project. The light show is powered by a stick of WS2812B RGB LEDs, commonly known by the Adafruit brand of NeoPixels. These RGB LEDs require perfect timing in order to display the correct colour,

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format5 min read
Tips For Managing Docker Containers
Everyone knows how containers revolutionised application building and deployment. Using a E disposable stack of containers that make up an app that aren’t using the docker-compose command to manage the stack are missing a trick. It allows the shippin
Linux Format1 min read
Installation Complications
The Linux Mint system package for Timewarrior was out of date, so we installed the latest version from Snap. The Hamster package in the distribution repository was the latest stable release (which is quite old), but we could also have installed via F
Linux Format3 min read
Drauger OS 7.6
We love the idea of a gaming-specific version of Linux, but Drauger fails to deliver. Given the setup/kernel issues, you’re far better off installing Ubuntu, then adding gamingspecific packages yourself. CPU: 1.8GHz (2GHz suggested) Mem: 1GB (6GB sug

Related