The implementation into hardware is quite straightforward. I mananged to squeeze all components into a PCB that is ony 13 mm x 19 mm. One notable trick was to use an edge connector for the SPI/TPI interface. Using a normal 6 pin header could have easily doubled the size of the board.
The software uses a timer interrupt to multiplex the 7 LEDs. The main routine calls the TinyTouchLib to poll the touchbutton. If a button press is detected, the value of the die is increased.
It turns out, that due to the small physical size, the touchbutton is somewhat unreliable and detects multiple touches when pressed. So I am using this in lieu of a random number generator...
Compiler output:
Program Memory Usage : 644 bytes 62.9 % Full Data Memory Usage : 7 bytes 21.9 % Full
Still some space left.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.