Arduino "Dice" roller
Feb. 27th, 2019 02:41 pmSo I'm working on building a dice roller thing with Arduino. Technically, it won't roll dice, though I suppose I could work on something that does. But it will have the same effect.
The idea will be to select die size and count, press a button, and then it will generate an appropriate random number.
Some design notes follow.
Basic UI:
Die Size Selector: Two buttons, to scroll up and down through various die sizes from D4 through D100. In the initial version, at least, it will only support those die sizes used in Dungeons and
Dragons 5th Edition. Seven Segment displays will be used to display this information.
Die Count Selector: Same hardware setup. This will be the number of "dice" to roll. Selectable quantities will range from 1-99.
The seven segment displays will be two digits- ideally, actual two digit units but if I can't source those at reasonable cost I'll resort to paired single digit parts. Driven by a shift register to ensure output pin requirements can be satisfied with an Arduino Uno.
Die Roller: A single button to roll dice as specified in the above, displayed on a 4 digit 7 segment display, again driven by a shift register to keep pin usage within the Unos capabilities.
Unanswered questions:
Can 2 digit displays be sourced at a reasonable cost? I've got a thought to try to sell these things if they function well, and very small differences might be critical in whether or not I can make that work. Buying a couple for prototyping is nothing, but for production it might matter. But also worth considering in the paired single digit solution is the need for more shift registers.
Speaking of shift registers, do I chain them or run them independently? The former will mean the least demand on Arduino output pins, but, the latter will make it easier to keep code driving each display more thoroughly separated. Cost should be the same. Maybe a couple cents difference over multiple units for the extra wiring.
The idea will be to select die size and count, press a button, and then it will generate an appropriate random number.
Some design notes follow.
Basic UI:
Die Size Selector: Two buttons, to scroll up and down through various die sizes from D4 through D100. In the initial version, at least, it will only support those die sizes used in Dungeons and
Dragons 5th Edition. Seven Segment displays will be used to display this information.
Die Count Selector: Same hardware setup. This will be the number of "dice" to roll. Selectable quantities will range from 1-99.
The seven segment displays will be two digits- ideally, actual two digit units but if I can't source those at reasonable cost I'll resort to paired single digit parts. Driven by a shift register to ensure output pin requirements can be satisfied with an Arduino Uno.
Die Roller: A single button to roll dice as specified in the above, displayed on a 4 digit 7 segment display, again driven by a shift register to keep pin usage within the Unos capabilities.
Unanswered questions:
Can 2 digit displays be sourced at a reasonable cost? I've got a thought to try to sell these things if they function well, and very small differences might be critical in whether or not I can make that work. Buying a couple for prototyping is nothing, but for production it might matter. But also worth considering in the paired single digit solution is the need for more shift registers.
Speaking of shift registers, do I chain them or run them independently? The former will mean the least demand on Arduino output pins, but, the latter will make it easier to keep code driving each display more thoroughly separated. Cost should be the same. Maybe a couple cents difference over multiple units for the extra wiring.