I wrote a function called buildUp to use every time the button is pushed, to build up the tension of what numbers the dice will show. My display has two rows of both 16 characters. I wanted to fill both rows with random numbers (up to six, like real dice) that will come faster with every number. That’s what the for loop in the buildUp function is for. If you’re display has more rows or characters you can adjust this code.
I set the delay to 220 milliseconds and divided this by 16. The number that you get is the number you’ll subtract from the countDelay every time the loop runs. If you want the numbers to show faster or slower, these are the numbers you have to adjust.
Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!
Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi
EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey