For this circuit, we used the joystick module to measure motion along the x and y-axis as well as the pushbutton for the z-axis. We then connected a multi-color LED to the Arduino and used the numeral outputs from the joystick module to alter the color of the LED. The result is an LED that changes to all colors of the rainbow as the joystick is moved around.
Process
Materials:
Arduino
Breadboard
Jumper Cables
Joystick Module
3 * 220 Ohm Resistor
RGB LED
USB Cable
In order to satisfy the main requirement of the recitation exercise, my partner and I first connected the joystick module to the Arduino. This process was very easy and once connected, we were able to see the output of the joystick’s different values as we altered its position along the x, y, and z-axis. We then thought that we could take this to the next step. So we decided to use the RGB LED from my Arduino kit. We then plugged the RGB LED into the Arduino as well, and with the help of 3 x 220 Ohm Resistors, the LED worked. Now, all we had to do was find a way to take the numeral outputs from the joystick and send them to the LED to make it responsive to the movement of the joystick module. With a little bit of coding help, we were able to accomplish this fairly quickly! We used the analogRead function to gather the information for the x, y, and z-axis. We then took the analogRead values and applied them to the integers we created for the RGB LED’s three separate color inputs. We then used the map function to convert the values from the joystick module into values that would apply to the RGB LED. Finally, we used the analogWrite function to send the values from the three different axes to the pins that corresponded with the LED’s three main colors: red, blue and green. The code took a bit of tweaking, especially with figuring out the conversion for the map function, but it worked surprisingly well, and our joystick was soon able to control the LED’s color.
Media
Question 1:
In the recitation exercise, I intended to assemble an RGB LED whose color can be changed at the will of the joystick module. If this sensor/actuator combination were to be used for pragmatic purposes, it could be used as lighting for theatrical performances in order to dramatize the set. The joystick module could be controlled by lighting technicians backstage in order to rapidly change the lighting of the theatre in order to match the mood of the stage actors. It could be dynamically used in this way or it could simply be a control for an everyday lighting fixture.
Question 2:
I believe coding is often compared to following a recipe or tutorial due to the nature of preciseness that must be followed when taking part in all of these things. If one part of the recipe isn’t followed, or one part of the coding isn’t typed correctly, then the entire product will not be correct. Coding is also similar to these activities in how every single step must be followed in order that the final product is actualized.
Question 3:
I believe that computers affect human behaviors by bringing us a greater awareness of the outside world. This is caused by the mass spreading of information from many sources. I believe because we have multiple platforms, social media, websites, and forums, we have an enhanced degree of communication between all sectors of society. This enhanced degree of communication leads to a greater humility among all humans in our everyday actions as we have a greater insight into the multiple perspectives of human beings around the globe.