Devices & Components
Arduino Uno Rev3
5 mm LED: Green
Solderless Breadboard Half Size
Jumper wires (generic)
Software & Tools
Arduino IDE
Project description
Code
flashledcode
arduino
1// 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. 2// 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. 3 4int 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. 5void setup(){// anything in this will only run once 6 pinMode(ledpin, OUTPUT); // this tells the arduino that the ledpin is an output 7 8 9} 10void loop(){ // any code in this will run forever 11 digitalWrite(ledpin, HIGH); // this make the ledpin high or turns it on 12 delay(1000); // this make the arduino pause before going on to the next line 13 digitalWrite(ledpin, LOW); // this makes the ledpin low or turn off 14 delay(1000); 15} 16
Downloadable files
led circuit
led circuit
led circuit
led circuit
Comments
Only logged in users can leave comments