Lab 1 Blink
Description
This is a blinking circuit with 2-3 LEDs. The example code has been altered from a 1 second delay to a 0.1 second delay, causing the circuit to blink faster than the example. I also added an additional 2 lights to see how a different number of lights in the circuit would affect their luminosity (brightness). I did this by removing resistor and adding the additional lights in various combinations.
I discovered that the green LED required more power (less lights competing for current) than the blue light to prevent it from dimming. The red light seemed to required the least amount of current because its brightness seemed unaffected by the presence of the either or both the blue and the green lights.
Components Used
- 2 - 3 LEDs (Red, Blue Green)
- 1 Arduino Uno
- 1 220
Code
/*
Deb Linton
Lab 1
Lab 1
Blink
Turns on an LED on for 0.1 seconds, then off for 0.1 seconds, repeatedly.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a fraction of a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a fraction of a second
}
Turns on an LED on for 0.1 seconds, then off for 0.1 seconds, repeatedly.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a fraction of a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a fraction of a second
}
Image
- Login to post comments
Drupal theme by Kiwi Themes.