In January I complained about the 'overkill' electronic dice, and I said I could do smaller and with less components. I just did, after getting 'new' 7segment displays.
Hardware wise it’s an ATTiny2313, 4x 7segment displays, 4 resistors and an USB cable for power. And a single button. All packed into a very tight space, with a lot of wires.
Software wise it runs on the ATTiny2313, which has 2K of flash. I’m using 1.3K of it, in which I have a configurable number of dice, configurable dice type. Long presses on the button switch between configuration and throw dice, while a single press throws the dice or increases the number/changes type.
The old 4x 7segment display was just 1 thing, with 12 connections (8x anode, 4x cathode) and I was planning to put the ATTiny2313 behind it. The new 7 segment displays are single 7segment displays, and so I had to connect all the anodes together myself.
The button is connected to the ground on one side, and other other side is connected to an input pin configured with pull-up.
I used 270Ohm resistors, and I shouldn’t have, the display isn’t that bright. But I had those resistors laying around, and didn't think about the 25% duty cycle. I’ll think I’ll update those when I change the power for this thing. The USB connection is only to test it. I want to run the power from a single AA battery, which I found some tricks online to make it work.
http://daid.mine.nu/blag/2011/04/08/har ... onic-dice/