This is the CircuitPython code for the Dicemaster 2000. It is a dice roller meant to be run on a Raspberry Pi Pico. It is connected to a MicroSD module as well as a PAM8302 audio amplifier. It also uses connections for 6 buttons (various dice), a ROLL button and a RESET button.
Feel free to modify as needed, but the original wiring was as follows:
The project was powered by 1n 18650 battery shield.
Buttons:
- D4 (4 sided dice) - GP16
- D6 - GP18
- D8 - GP21
- D10 - GP26
- D12 - GP27
- D20 - GP28
- ROLL - GP0
- RESET - GP6
SD card reader module:
- SCK - GP10
- MOSI - GP11
- MISO - GP12
- CS - GP13
PAM8302 audio amp:
- PWM audio out - GP9
This project uses the adafruit_sdcard module as well as audiomp3, audiocore and audiopwmio, and a few other standard modules.
The audio files in /sd/dice should be stored in a microSD card in a directory called /dice
When the system is powered on, the SD card will be mounted for the Pico as /sd
The original 3d print files for this project can be downloaded here: https://www.printables.com/model/839218-dicemaster-2000/files