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? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Maker Business — Aquarium troubles: the cost of iteration and troubleshooting with a manufacturers abroad
Wearables — Victorian Arduino pizzazz
Electronics — Counting Pin Numbers
Biohacking — Exploring Our Inner Reality : Entopic Visions
Python for Microcontrollers — CircuitPython 3.0.0 Release Candidate 0 released!
No comments yet.
Sorry, the comment form is closed at this time.