For a youtube video of this project -
Project files: https://drive.google.com/drive/folders/1zcBWEh8e02feQmw8CFYfhjW5JC-o-0de?usp=sharing
Today we’re going to make a wearable digital dice roller. Using the buttons you can scroll through all the usual polyhedral dice, this one scrolls forward and this one goes back, and with the flick of your wrist you can roll the selected die. A little red led illuminates to let you know the dice has been rolled, just in case you roll the same number twice. Pretty nifty, what's more it costs less than 15 quid and is pretty easy to set up!
To use UI Flow, you first need to download M5burner. This is a tool to flash your m5stick with firmware that can understand UIFlow’s micropython programming. Once installed, open it up and select STICKC on the left, then download the latest version of UI flow in the main window. Plug in your M5stick and select the correct COM port at the top, pretty familiar if you’ve ever tried any arduino stuff. Be sure to select 115200 as the baudrate. Click Configuration and set the start mode to Internet Mode, as well as entering your wifi name and password. Hit save, then hit burn.
Once that’s done, you need to open up your web browser and go to flow.m5stack.com. There is a desktop version of this, but it gave me nothing but hassle, so I’d recommend sticking with the web version for now. You’ll be prompted to choose a version, I’ve been using the beta and haven’t had any issues with it. Then go to the menu at the top right and click settings. Change the device to stickC. For the API key, this should already be on your M5Stick screen if it’s turned on. If not, turn it on with the button on the left side and enter the API key.
Click the little refresh icon at the bottom and, all being well, it will say connected. To get up and running with the DnD dice, first we’ll need to add the required background image to the m5stick’s flash memory. Click the manager button to the left of the play symbol at the top, and then add image. Find dndlnd2.jpg that was included with my project files and hit open, give it a minute to upload and it should appear under the add image button. Hit cancel to close the window, then go to the menu at the top right again. Click open and find D&D DICE FINAL.m5f. Open that up and once it’s loaded, press the play button.
Over on your M5stickC, the app should be loaded up and ready to roll. Geddit...
If you turn it off and back on again, then the m5stick will go back into internet pairing mode but you can also make it boot straight into the dice app. Turn the device off by long pressing the button on the left, then press both the font and left side buttons together while it turns on. This brings you into a settings menu, and you can use the button on the right hand side to navigate to the Applist. Press the front button to select, and choose the topmost one - usually called temp.py. Then you’re back in the dice app, and it will boot straight into it every time you turn it on. Jobs a goodun!
Comments