PWM with multiple LEDs

So I'm just starting to code with my cc3200 and my professor told us to use pwm and for loops to fade in/out all three LED's one after another for homework. My only problem with this is that he specifically instructed us to have them all fade into another. So after the first green LED has faded in, as it is fading out, the next yellow LED should start to brighten and fade in and so on. after all that it needs to go the opposite direction and repeat. Also I am using the LED's on the cc3200

I can't seem to figure out how to get the yellow led to fade in as the green one fades out using for loops

thanks for any help!

What is cc3200?

Is it Arduino compatible?

A Ti microcontroller, and yes it is

A state machine can do that. The first state fades in the green LED, the next state fades out the green and fades in the yellow LED, and so on.

It should be easy enough to fade one led in and one out in the same for loop (assuming the cc3200 can be treated just like an Uno for example).

I don't see why a state machine is needed for this exercise, it is a generally useful technique, but it would overcomplicate things and do nothing to solve actual problem in this case.

Post your sketch and we can advise how to amend it. Read the forum sticky post to find out how to use code tags.

I am trying to do the same thing. Any luck?

Skg11228:
I am trying to do the same thing. Any luck?

No need for luck here. It is super easy. When you need help read "How to use this forum" sticky and follow instructions.