Circuit 1 - Blinking an LED
The Code
The code for our first circuit was fairly easy. This code is able to turn an LED off and on repeatedly. It can be changed to make the light blink at any speed.
In Action
Here is the output for the original code given to us by Arduino. The LED blinks on and off every second, or 1000 milliseconds.
Process
The Code
The delay was originally 1000 milliseconds, but we changed it to 100. Therefore, our LED will turn on and off every one tenth of a second.Â
In Action
My partner and I decided to manipulate the code to make the light blink faster, as the code suggests. See it working below!
Circuit 2 - Potentiometer
In Action
As we turned the potentiometer to the right, the LED is visibly blinking slower. This can also work the opposite way, making it go faster.Â
The Code
A potentiometer works as a resistor, but is adjustable. It has a crank that can adjust the resistance. The code shows that the potentiometer is connected to the LED pin, and when it is turned a certain way makes the LED blink faster.
Circuit 3 - RGB LED
The Code
The code only directs the LED to flash individual colors. It turns off and on certain colors to mix and create a color to display.
In Action
With the help of the given code, our RGB LED gave off both a steady spectrum of colors and also flashed individual colors.Â
Process
The Code
Instead of showing colors one by one, this code directs the LED to fade into each color seamlessly.
In Action
This is our RGB LED only showing the spectrum, not the flashing colors.
Circuit 4 - Multiple LEDs
In Action
The function used to display this turns on one light at a time, then lights the next one until all are lit. This loops forever!
The Code
As each pin is turned on, there is a small delay time between each. The code shows how each light is turned on and kept on to show the sequence of LEDs.
Process
In Action
Instead of the LEDs going off in a uniform sequence, the lights go off at random positions and intervals.
The Code
The code picks a random LED to go off one at a time, then keeps it on for a short period and picks another LED to light up.
In Action
This function is very similar to the first. The code turns one LED on, waits, then turns it back off and goes to the next pin.Â
The Code
Since the code is similar, it also looks similar when the code is running.
Circuit 5 - Push Buttons
The Code
The code tells the light to turn on if one or the other button is pressed, but when both are the light turns off.
In Action
Here you can see me pressing both lights individually and together.
Circuit 6 - Photo Resistor
In Action
Here is the ManualTune function in action.
The Code
The two functions are called individually and change the way that the photo resistor takes in light and how the LED pin reacts.
Process
The Code
The manual tune has its benefits. With this function being called, I noticed that the LED glows a bit brighter and is more reactive to light changes. One downside is that this function causes the LED to never fully turn off.
In Action
Here is me putting my finger over the photo resistor to test different amounts of light.
The Code
This function sets the lowest and highest light values. It is different from ManualTone because of this, but otherwise uses the same code.
In Action
Here is how the photo resistor reacts to light through the LED with AutoTune. It does not glow as brighter, but is also fully turned off when light is detected.
Circuit 7 - Temperature Sensor
In Action
The loop function finds the temperature that the sensor is picking up, and calculates it into both Celsius and Farenheit. Then it prints out for us to read.
The Code
Here you can see how the temperature of the room we tested our arduino in, both in Celsius and Fahrenheit.
Process
In Action
I put my fingers on the temperature sensor to heat it up above 78 degrees F. Once the sensor reads above that number, the LED turns on.
The Code
For the process grade, we had to code an LED to turn on when the temperature is recorded above a certain number. When the temperature reads above 78, the light will turn on. In any other situation, the light will remain off.