Thursday, October 8, 2015

fade led by using Arduino Program

Fade Led simple program
 



Apparatus required:


1X Arduino board

1X Led

1X DC supply





Construction:


Step 1:  Upload the program given below in to Arduino board 


Step 2:  Connect the Arduino and Led in to the pins 


Step 3: Now connect Arduino into power supply 


Step 4:  Now your led fade is done


Step 5: Follow us and subscribe our YouTube channel





Program:    
                                                                                                                                              
       



int led = 9; // the pin that the LED is attached to

int brightness = 0; // how bright the LED is

int fadeAmount = 5; // how many points to fade the LED by




// the setup routine runs once when you press reset:

void setup() {

// declare pin 9 to be an output:

pinMode(led, OUTPUT);

}




// the loop routine runs over and over again forever:

void loop() {

// set the brightness of pin 9:

analogWrite(led, brightness);




// change the brightness for next time through the loop:

brightness = brightness + fadeAmount;




// reverse the direction of the fading at the ends of the fade:

if (brightness == 0 || brightness == 255) {

fadeAmount = -fadeAmount ;

}

// wait for 30 milliseconds to see the dimming effect

delay(30);

}



For further questions follow us and ask in  Contact Form. You will receive response in 24 hours
                                 

Related Posts:

  • Arduino Project to control Traffic signals Circuit Diagram: Apparatus required: 1x red led 1x yellow led 1x green led 1x Arduino board 1x Breadboard Connecting wires Connection: Connect Arduino and bread board with connecting wires connect pi… Read More
  • 2x2 led matrix 2x2 led matrix           Apparatus required: 1X ARDUINO UNO  4x LED 1X BREADBOARD 4X 200 OHMS RESISTER       SOME CONNECTING WIRES CONSTR… Read More
  • Create your own free website within 2 minutes!! Must watch this video  Step 1:  visit    www.blogger.com Step 2:  Click new blog Step 3:  Enter title of your blog/website Step 4:  Enter you… Read More
  • Breadboard Working Learn how to use breadboard by this video Need:      Many of us don't know how to use bread board and what are the connections available in the circuit.    That is the reason we have pu… Read More
  • Electric power from dc motor as a dc generator Electric power from dc motor as a dc generator Apparatus required: 1x dc motor 1x led 1x 200 ohms resister 1x wheel Construction: Step 1:  Fix the dc motor and wheel in … Read More

0 comments:

Post a Comment