kmoore22
Published © CC BY-NC-ND

Robotics Project

Turning on one LED for 2.5 seconds then switching LEDS.

BeginnerShowcase (no instructions)476
Robotics Project

Things used in this project

Hardware components

LED (generic)
LED (generic)
×2
Resistor 220 ohm
Resistor 220 ohm
×2
Jumper wires (generic)
Jumper wires (generic)
×3

Story

Read more

Schematics

sketch_dec12a_iNUPqZfgQs.ino

Code

Code

Arduino
Code
void setup() {
  // put your setup code here, to run once:
pinMode(6, OUTPUT); //set the LEDS as outputs
pinMode(2, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(6, HIGH); //turn on the LED for 2.5 seconds
delay(2500);
digitalWrite(2, HIGH); //turn on the second LED for 2.5 seconds
digitalWrite(6, LOW);
delay(2500);
digitalWrite(2, LOW);
}

Credits

kmoore22

kmoore22

3 projects • 0 followers

Comments