This week the Maker Challenge was to design our own LED dice using the Arduino. When I first read about the dice project last week, I didn’t realize that we would be using the LEDs to be the actual dice. Of course, now after working on the project, I understand how the LEDs make a pretty good dice and they are colorful and interesting to look at.

To begin this project, I started with watching Dr. Bigenho’s video and also looked at a few different tutorials online. I found a few written guides with pictures that helped me to get a better idea of how to complete the project. I also watched a YouTube video and this helped to see someone setting it up and explaining it verbally instead of having to follow along in text. I ended up deciding to use this tutorial https://www.thegeekpub.com/16607/easy-arduino-dice-circuit/. I liked The Geek Pub tutorial because it used images of the build similar to the SIK Guide which I have become familiar with during this class. It did get confusing trying to follow so many different wires and a few times I placed the LED the wrong direction and had to correct which prong to use. After a few errors and then correcting those errors of where wires, resistors, and lights were placed, I did succeed in making the dice work. However, I would not have been able to do it without the help of the tutorials.

Below is The Geek Pub image that helped me the most:

And here is the reality of what it looks like on my Arduino:

In this build, pins 2–9, 3V and both grounds are being used. Basically each numbered pin’s wire is placed next to the resistor and the LED that it is going to power. That is why the cords look to be all over the place. The set up kind of reminded me of a spider. I have not used so many LED’s in one build before this project. It was fun to make sure each light was going in the right spot with its wire and resistor while also arranging the lights in the shape of a dice.

Below is the code I used which The Geek Pub tutorial provided:

The code explains that even though it could have been shortened, the creator left it in this format so that it would be easier for beginners to understand. This was very helpful to me and I appreciated how comments that were informative but concise were left to explain what each part of the code was for.

I think this is my favorite project we have done so far with the Arduino because I enjoyed making a project that had a real purpose and it felt more tangible because it had the same function of a real-life object. More than just blinking in a certain way to look pretty or in a certain way to show it could follow instructions, it was actually accomplishing a purpose by giving a number back. I also like how this dice mimics the behavior of real dice and it was fun to play with the code and figure out how I could alter that behavior by changing the numbers in the code.

My favorite part of the code was how it told the lights to pretend to be rolling or thinking about what number it was going to choose. I really just liked the whole behavior of the lights and how their changing behaviors created the concept of the dice. Another important behavior that made the dice a dice was how the lights stayed lit when declaring the random number that was chosen.

To experiment more with this, I tried changing the code to alter the behavior of the LED dice. Below is an image of part of the changed code. The comments explain that this part of the code is responsible for the dice appearing to “think” as it is rolling. I decided to change the delay number which was originally set to 60 to 30 so that the lights would blink faster during the “thinking” stage. I also changed the i < number from 5 to 10 so that the dice would repeat its thinking pattern 10 times instead of 5. I didn’t actually think it needed to be changed because I liked the timing of the lights and number of cycles but I wanted to change it just to see if it would listen and it did!

The next part of the code I changed was the delay time for the “if” statements at the bottom. The original delay time was set at 5000 and I set the new one to 10,000. This made it so that when the dice did select a random number 1–6, those lights representing the chosen number would stay on longer than they did before.

To continue with the code tweaking, the last number I changed was this first delay number before the if statements. The delay number was originally set to 300 and I changed it to 3000. This made it so that after the dice is done thinking, all the lights will remain turned off for a longer period of time before lighting up with the chosen random number.

Below is a video of me explaining the changes:

Now that the dice project is complete and I was able to tweak the code and explore how that changed the behavior of the dice, I am able to take a step back and think more about what the experience did for me. I think this project helped me to feel more comfortable with jumping into the code. I had more confidence because I have already tackled a few projects and had to figure out the code as I went. I knew that the comments would help clear up any confusion I had or there would at least be some kind of explanation from another source to help me figure it out. Of course, I am relying on someone else’s code to help me with the project so this won’t always work out but I think I was less intimidated this time because I knew I could find an answer out there. I also felt capable of examining it and figuring it out even if it took awhile.

Overall, it did not take me as long as it usually does to understand what the code was saying. I think this was also a combination of me being more comfortable because of previous experiences and also getting lucky and finding a really good tutorial with code that explained enough but not too much and was well organized. I also had more natural excitement for this project because I am a big fan of card games and board games which I play with my family so the idea of designing a dice with the Arduino was something I was looking forward to.

There are a lot of real world examples of dice but for using the LED dice specifically, I am not sure of one I had seen. I could imagine one being created as a novelty dice though for a gift. I am picturing a regular dice that you are able to hold in your hand and roll like normal but the circles could be filled with small LED lights that will light up when they are landed on. This would also be fun to be able to see the dice roll even in a dark room. It would be similar to glow in the dark dice but more impressive and more reliable because it would not be dependent on soaking up light in order to glow. Especially since most dice are kept in a dark bag anyway, the LED dice could be a fun item to add to game night.