bichon5962
Published © GPL3+

LED project

This project is developed to learn how to use LEDs on arduino

BeginnerFull instructions provided400
LED project

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
arduino Mega 2560 or arduino uno
×1
LED (generic)
LED (generic)
the colors you want
×5
Resistor 220 ohm
Resistor 220 ohm
or 100 ohm
×6
Jumper wires (generic)
Jumper wires (generic)
×1
LED(RGB)
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

DIAGRAM

Code

LED CODE

C/C++
void setup() {
  // initialize digital pin 2,3,4,5,6,8,9,10 in output.
  
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  
 

}
// the loop function runs over and over again forever
void loop() 
{
  delay(1000);
  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);
  digitalWrite(2, LOW);

  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);              // wait for a second
  digitalWrite(2, LOW);    // turn the LED off by making the voltage LOW
  delay(50);              // wait for a second

  digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);              // wait
  digitalWrite(3, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait

  digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);              // wait 
  digitalWrite(4, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait 

  digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);              // wait 
  digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait 

   digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);                //wait
  digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
  delay(100);  // wait 
 
//RGB LED
  digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);              // wait for a second
  digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW
  delay(300);  // wait

  digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);              // wait for a second
  digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW
  delay(300);  // wait

  digitalWrite(10, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(300);              // wait for a second
  digitalWrite(10, LOW);    // turn the LED off by making the voltage LOW
  delay(300);  // wait 
  
}

Credits

bichon5962
0 projects • 0 followers

Comments