PWM using for loops

I can't seem to find a way to get my 3 LED's to fade into one another. After the first g LED fades in, as it begins to fade out, I need the next y LED to start fading in as well, then the same process would happen going to the next r LED.

I cant figure out how to do that using for loops, any advice?

Thanks!

brandonpadilla0:
I can't seem to find a way to get my 3 LED's to fade into one another. After the first g LED fades in, as it begins to fade out, I need the next y LED to start fading in as well, then the same process would happen going to the next r LED.

I cant figure out how to do that using for loops, any advice?

Thanks!

Fix your code. If you need help with that then you should probably ask someone who can see it to help you figure out what is wrong with it. Then you can see what it is that you are misunderstanding.

But here's a hint. For loops are blocking. To get what you want, I doubt you will use any for loops. For loops are for demonstrating how to fade a single led to show how analogWrite works.

Delta_G:
Fix your code. If you need help with that then you should probably ask someone who can see it to help you figure out what is wrong with it. Then you can see what it is that you are misunderstanding.

But here's a hint. For loops are blocking. To get what you want, I doubt you will use any for loops. For loops are for demonstrating how to fade a single led to show how analogWrite works.

I've been thinking the same thing myself. I would try and do it another way but these instructions were assigned to me by my professor as a small homework assignment. :cold_sweat:

brandonpadilla0:
I've been thinking the same thing myself. I would try and do it another way but these instructions were assigned to me by my professor as a small homework assignment. :cold_sweat:

Well you know what has been the concept you are covering in class. Probably best to incorporate the current lesson. We might get you a zero by telling you the best way to do it and that might not be what the prof is after.

Delta_G:
Well you know what has been the concept you are covering in class. Probably best to incorporate the current lesson. We might get you a zero by telling you the best way to do it and that might not be what the prof is after.

Yeah good point. Thanks for the advice, ill get back to it!