Lab 1 Submission
This is my Lab submission.
Description:
I have three LED lights that are plugged into pins 11, 12, and 13. Each light is blinking at a different speed.
Components Used:
- 3 LED Lights
- 3 220 ohms resistors
- Breadboard
- Arduino
- 3 grounding cables
- 3 power cables
- USB Cable
Code
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int red = 13;
int green = 12;
int blue = 11;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(red, HIGH);
delay(100);
digitalWrite(green, HIGH);
delay(400);
digitalWrite(blue, HIGH);
delay(200);
digitalWrite(red, LOW);
delay(100);
digitalWrite(green, LOW);
delay(400);
digitalWrite(blue, LOW);
delay(250);
}
- Login to post comments
Drupal theme by Kiwi Themes.