No musical circuit today . Since few weeks I’m messing around (and get pissed of) with my arduino board. It’s a really nice tool to create project. But I realised that it’s pretty limited on its own for audio application. I’m planning to buy DAC for that reason.
So here’s a code written on my own , it’s an electronic dice . Nothing special . I saw few ideas with the same goal . I was playing around with 7 segments displays, shift registers , for an education purpose, and I realised that a dice would be quite simple . Things get simpler when you understand how they work . Anyway here’s a (blurry) picture made with a diying battery Iphone :
When the button is pressed, the µC takes a random number between 1 and 6 and display it on the 7segment display after a sequence lighting the segments aternatively.
here’s the code for it at the github site:
sorry no layout and wiring diagram , it’s really straightforward . You’ll find how to hook it quickly.
Why not a .ino file ? I tried to put a .txt files on wordpress server and it doesn’t like it. so github link. Beside, one ennoying thing with arduino files is that they create a folder , it’s a bit boring when you just want to read the code but no necessary use it. Beside, the software does also some weird thing with folders (yes I’m this kind of guy , always complaining about something…)
I’ve also tried to make the comments as clear as possible. I find that sometime they’re not really helping if your’re a total newbie. So I hope mine is a bit more precise.
I think It can even be simplified with a bitshift operation to replace the first sequence. Adding a second 7 segments display and shift register can be quickly done for a double dice or for a set of two independant dices. Increasing the number until 9 and adding the zero, and In the case,of a double dice, it could generates a random number between 00 to 99.