// plug led in breadboard. Then plug in two wires one on the negative and the other on the positive side of the led. The positive side is the side with the long leg.
// plug the positive side in to digital pin 4 on the arduino. Then upload this code. YOu should see the led flash on and off.
int ledpin = 4; // tells the arduino board what pin the led is on. You could use a different pin but make sure to change the number.
void setup(){// anything in this will only run once
pinMode(ledpin, OUTPUT); // this tells the arduino that the ledpin is an output
}
void loop(){ // any code in this will run forever
digitalWrite(ledpin, HIGH); // this make the ledpin high or turns it on
delay(1000); // this make the arduino pause before going on to the next line
digitalWrite(ledpin, LOW); // this makes the ledpin low or turn off
delay(1000);
}
Comments