In this week’s challenge, our goal was to learn use the random function, custom embedded functions, for loops and if statements to create a random dice roll and then count the distribution of dice rolls.
2. Code:
The following code displays a random dice roll on a 7-LED array and counts the distribution of rolls for 100 dice rolls.
3. Circuit Design:
For the following circuit design, the 7 LED's are arranged so a to display the typical dice number arrangements from 1 through 6 for each random number that is generated.
Video of Circuit for Random Dice Roller (0:25)
4. Electronic Diagram:
The following electronic diagrams were taken from my design journal.
For the following circuit design, the potentiometer functions as a color selector. Turning the knob on the potentiometer will determine which color the RGB LED will shine.
Electronic Diagram for Random Dice Roller
5. Video of Project:
Description of Project to Create Random Dice Roller (2:52)
6. Explanation of Project:
I started this week by learning how to use the random() function to generate the integers 1 through 6. I initially plugged in 6 as the "max". However, using the serial.print output, I was able to quickly discover that this only generated numbers 1 through 5 and corrected my mistake by changing the "max" to 7. This correctly generated the random numbers I wanted.
Next, I wrote a function to take the random dice number and display it on my 7-LED arrangement. This took a little troubleshooting on the syntax of my if statements, but it looked really cool once it started working!
Finally, I automated the counting process to track how many times I rolled a 1, 2, 3, 4, 5 or 6 in 100 rolls. I then displayed that using the serial.print function so that I could graph it when I was done!
7. Reflection:
This week was a lot of trial and error. I decided to challenge myself by starting my code completely from scratch without any references or guides. I was able to learn more about how integer variables work, how to use for and while loops, and how to use embedded functions to reduce the amount of repetitive coding I would need to do. It think this will help me be more efficient in the future.
8. Applications:
A very obvious application for this would be the computerized slot machines at casinos. It makes you wonder how fair these machines actually are, and what random seeds they use as their input to their random functions. I'm sure someone monitors their code... I would hope! But it seems like a giant loophole for casinos to make more money!
9. Graph of Dice Roller Distribution
Below is the graph of my dice roller number distribution for 100 rolls.
I've always considered learning to be a lifelong journey. If I'm not learning, exploring, expanding my skillset, pushing my boundaries and trying new things, I'm not living my best life. In this vein, I will certainly be continuing my exploration of Web 2.0 (and 3.0) technology and beyond well past the completion of this course. Conferences and Conventions: I love the education and networking that happens when energetic, knowledgeable, motivated people get together and idea-swap! When choosing conferences and conventions to attend, I look for ones in areas of interest or potential future interests and prioritize ones with hands-on, workshop-style events -- I feel like a learn the most from these and I get to see the teaching methods modeled more realistically than in a lecture-style conference. My Network: One of the great things about loving my job is that I talk about it a lot. Weddings, class reunions, kids birthday parties, random people I run into in line a the coffe...
What is a Course Management System? According to the Vanderbilt Center for Teaching : A course management system (CMS) is a collection of software tools providing an online environment for course interactions. A CMS typically includes a variety of online tools and environments, such as: An area for faculty posting of class materials such as course syllabus and handouts An area for student posting of papers and other assignments A gradebook where faculty can record grades and each student can view his or her grades An integrated email tool allowing participants to send announcement email messages to the entire class or to a subset of the entire class A chat tool allowing synchronous communication among class participants A threaded discussion board allowing asynchronous communication among participants So, how is this different from a Learning Management System? I'm still trying to figure that out, and there seems to be a lot of overlap in the definitions. Exploring CMS...
1) Project: This blog post follows my initial exploration of my Arduino Super Starter Kit as I attempt to complete the "blinking led" project. The goal is to use the Arduino IDE interface to write code for a blinking LED, build a circuit using my Arduino, breadboard, wires and LEDs, upload my code to my Arduino, and then explore different variations and possibilities in the realm of blinking LEDs. Video 1: Unpacking my Arduino Kit! 2) Code: Here is a screenshot of my annotated code for the blinking LED project. 3) Circuit Design: Here is a video showing the circuit I built using my Arduino and breadboard. Video 2: Circuit for Blinking LED Challenge 4) Electronic Diagram: Below is the electronic diagram from my design journal: 5) Video of Project: While not necessarily a "successful" implementation of this week's assigned project. I learned a lot about how to trouble shoot Arduino connections issues, which will hopefully save me time and headaches in the future ...
Comments
Post a Comment