Task:
- Learn the basics of Arduino and the breadboard.
- Understand basic C++ coding used
resistor used:
brown-black-red-gold
Continuous Blink:
Here is the basic Arduino. The most basic coding makes the Pin 13 (L) LED blink on and off depending on what the delay() time is in the code.
This is what the code looks like for a delay of 10:
void loop()
{
digitalWrite(13, HIGH);
delay(10);
digitalWrite(13, LOW);
delay(10);
}
Using void loop(), the next six lines of code will repeat infinitely. digitalWrite has two options, and HIGH is the voltage level. In that case, the LED turns on. delay(10) will keep the LED on for 10 milliseconds. With a LOW voltage level, the LED will turn off for a delay of 10 milliseconds. Because 10 milliseconds is extremely fast, the human eye cannot see it so the LED will appear to be on the entire time when in reality the LED is blinking continuously.
Pattern:
Use three different LED colors to create a light show pattern using delay(). In the code, three chunks of digitalWrite and delay are coded for the three separate LED lights individually, each with different delay times.

Here is a video of our coded pattern:
Use the potentiometer to change brightness of the LED light. The potentiometer resistance is directly proportional to the change in voltage supplied to the LED light (power), and the current (speed) is inversely proportional to the resistance. I = V/R. Current = Voltage/Resistance.
Here is the potentiometer in action:
In the video, when the potentiometer is turned in the counterclockwise direction, the LED light starts blinking at a faster rate. When the potentiometer is turned all the way in one direction, there are 0 volts going to the LED, and when it is turned all the way to the other direction facing the orange wire, 5 volts goes to the LED. In that case, the voltage increases, resistance decreases and therefore increases the rate at which the LED flashes.
When the potentiometer is turned all the way to the orange wires, the LED is blinking so fast it appears to be on the entire time. This is similar to what I mentioned above in the Continuous Blink section.

Here is a video of our coded pattern:
Potentiometer:
A potentiometer is a knob controlling the rate at which the LED blinks. It has three legs. The top leg connects to a 5V power source, the middle leg connects to the A0 port, and the bottom leg connects to ground (GND).Use the potentiometer to change brightness of the LED light. The potentiometer resistance is directly proportional to the change in voltage supplied to the LED light (power), and the current (speed) is inversely proportional to the resistance. I = V/R. Current = Voltage/Resistance.
In the video, when the potentiometer is turned in the counterclockwise direction, the LED light starts blinking at a faster rate. When the potentiometer is turned all the way in one direction, there are 0 volts going to the LED, and when it is turned all the way to the other direction facing the orange wire, 5 volts goes to the LED. In that case, the voltage increases, resistance decreases and therefore increases the rate at which the LED flashes.
When the potentiometer is turned all the way to the orange wires, the LED is blinking so fast it appears to be on the entire time. This is similar to what I mentioned above in the Continuous Blink section.
No comments:
Post a Comment