ankitha_kadem
Published © GPL3+

LED fade using Arduino UNO with code

This project is about changing the intensity of LED periodically.

BeginnerProtip8,164
LED fade using Arduino UNO with code

Things used in this project

Story

Read more

Schematics

LED interfacing to Arduino UNO

Code

LED fade

C/C++
Final version of the code
int intensity = 255;
int intensitychange = 1;
int d = 5;
void setup() {
 pinMode(10, OUTPUT);
}
void loop() {
 analogWrite(10, intensity);
 delay(d);
 intensity = intensity + intensitychange;
 if((intensity == 0) || (intensity == 255))
 {
   intensitychange = -intensitychange;
 }
}

Credits

ankitha_kadem

ankitha_kadem

0 projects • 0 followers

Comments