When turned on, all the LEDs will light up and the user have to press and hold on the button to roll the dice. Once the user lets go of the button, the rolling will stop and the dice pattern will be displayed. The LEDs will light up in the same pattern as a traditional dice for easy reading.
Here is how it’s connected :
And here’s the assembly code (for curious ones, I edited the asm file using Notepad++).
Before uploading it into the hardware, I was required to perform a software simulation first to show that the code is correct and functional.
Here is a video of the simulation :
And as expected, it works flawlessly, so here it is in the actual PIC16F84A :
Apparently rolling a dice is hard work, now we can just push a button 🙂