In this week’s challenge, our goal was to learn how to use the color-changing RGB (red, green, blue) LED and play around with Arduino C coding to learn how to use For loops and Arrays. Then combine that new knowledge to create a project.
2. Code:
The following code combines my experimentation with the potentiometer and my understanding of how the AnalogWrite function can work to control the color of my RGB LED. After briefly running through the range of colors, by LED blinks off. Then the color can be controlled by turning the potentiometer dial.
3. Circuit Design:
For the following circuit design, the potentiometer functions as color selector. The PWM (pulse width modulation) digital output pins control the intensity of each color (red, green and blue) of my RGB LED.
Video of Circuit for Potentiometer as Color Selector (0:49)
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 Potentiometer as Color Selector
5. Video of Project:
Combining RGB LED and Potentiometer to Dial in Colors (2:24)
6. Explanation of Project:
I started this week by learning how to use the color-changing RGB (red-green-blue) LED. It's actually a combination of 3 different LED elements. As the brightness of each varies, it produces different colors. After reading the background on how PWM (pulse width modulation) outputs for digital pins work, I was able to successfully manipulate the RGB LED using my Arduino to set it to different colors using the analogWrite() function. From here, I added on to my code.
First, I automated the LED so that it could transition through the whole spectrum of colors. I did this by building two different functions. Since each of the analogWrite() functions for the three input pins could send a value between 0 and 255, I chose to fade each color in or out while holding the 3rd color constant. In total, this gave me a range of 767 unique color combinations. My first function showSpectrum() used a for loop to cycle a variable "x" from 0 to 767. This function referenced my second function showRGB(), which took the variable "x" as an input and then wrote a unique analogWrite() output to each of the RGB LED pins to represent that color.
Extension Challenges:
After getting this project to work, I attempted some of the extension challenges by combining the code I created with some elements of previous projects. I encountered several challenges (see notes in code for some solutions), but was eventually able to get my potentiometer to function as a color selection dial. Each dial position generates a unique RGB LED color!
I accomplished this by writing a third function showPOT(), which reads the analog signal from the potentiometer from 0 (0V) to 1023 (5V). The functions then references the showRGB() function described above to generate a unique color output for my RGB LED!
My final code combines these two projects by first cycling through the color spectrum in 7.67 seconds, then turning off for 1 second, then using the dial location on the potentiometer to select a specific color.
7. Reflection:
I had a lot of fun playing with circuits this week because it was a very open-ended challenge. I learned how to use the PWM and how the digital signal masquerades as an analog output allowing us to analogWrite() with digital pins. Through trial and error, 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:
In addition to this coding project this week, I also ran the light and sound boards for a student showcase circus performance on Saturday evening. In preparation for the show, I had to program the LED spotlights for each of the aerial points, trampoline and flying trapeze lights to allow me to cue different locations and colors for each act. Similarly to how I coded the separate functions for light color and signals to change the light color, I used separate functions to focus the stage light location and select the color so that I could achieve a broader variety of combinations without specifically programming all of the acts as separate cues.
Overall, the show was a success! I was able to streamline the process and had a successful tech run with a better understanding of the process.
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...
My First Wiki While I've made use of massive online wiki sites (like Wikipedia) before, I have never created my own wiki. This week I used PB Works to create an educational wiki and begin to populate it. While some parts of creating my first wiki were pretty simple, I found some downsides to using this tool as a form of educational intercourse and distributed learning platform, which I will discuss in further detail below. Getting Started with PB Works To kick off my first personal wiki page, I created an account with PB Works. This alone took several hours as there appears to be some sort of glitch in the registration process where I had to work my way through several help channels before I could get my email address confirmed. Once my account was created, then I created my first workspace. Here's what a blank, default educational account workspace looks like when you generate it: As you can see, some fields are populated with a bit of information to get you started, but overa...
Comments
Post a Comment