656Views1Replies

Author Options:

How do you make 2 LED's fade (PWM) consecutively on an Arduino? Answered

I want 2 LED's to fade one after another but i can't figure out the code yet. 

Tags:arduino

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
steveastrouk
steveastrouk

Best Answer 8 years ago

Both starting bright ?
Try this

analogWrite(led1,255);
analogWrite(led2,255);
for (int bright=255;bright>0;bright--)
analogWrite(led1,bright);
for (int bright=255;bright>0;bright--)
analogWrite(led2,bright);



Steve