Twisting the Possibilities with Arduino

 

Arduino From Ordinary to Extraordinary

Hello guys!
Welcome to the world of arduino.
We are at new project.
 LED either ON the or OFF digital prints but we have to find a method with which we can dim the LED.
This Method is to use analogue with the use of this we can get output from 0 to 5 volt in between all values such as 1, 2 and 3
so if we increase the voltage the brightness of LED bill increase.


0------------5V
0 ------------255
At Arduino board highest voltage is 5 volt but in coding zero corresponds to 0 and 5 volt corresponds 255.

Circuit

Coding

Use digital pins with symbol of analogue ~

So now write a program
int redpin=9;
int bright=255;
Here 255 corresponds to 5 volt.
void setup()
{
pinMode(redpin, OUTPUT);
}
void loop ()
{
analogWrite(redpin, bright);
 We declared bright variable is equal to 255 which means 5 volt that mean the LED will be turn ON.
}
Change the value of bright in above declared variable if we write zero voltage LED will be off.
If we write 125 then LED will be dim.

Conclusion

Now with the help of analogue we are abled to regulate LED from 0 to 5 voltage we can give it voltage zero, one, two, three and four so we are successful in our project.

Assignment

Take an led and a resistor make a circuit as previous. The led should be off for 5 seconds, then dim for five seconds and then full brighten for five seconds.
Hint:
You have to declared 3 variables for brighting as bright1=0;
bright2=125;
bright3=255;
Ok.
Best of luck


Comments

Popular posts from this blog

Code, Create and Innovate

Blink, Blink, Revolution

Taking LED sequencing to Next Level with Arduino