LED Fading Times Issue

So what I'd like the program to do is this:
LedPin3 will start bright and fade out at the same time LedPin5 will start off and brighten
[each decreasing brightness by 5 at a time, in terms of duty cycle]

And then vice versa so they're fading in/out at the same time. Repeat

This is working fine, got it going. But that's where I hit the wall and will appreciate any help.

The clincher is I have to somehow make the time it takes to fade on start with 200 and then fade off with 1000 (each counting down by 1 in a loop of some sort, and ya I realize it will throw them out of sync). I have to use only these as my variables:

int const ledBrightness3 = 255;
int const ledBrightness5 = 0;
int const fadeTimeOn = 200;
int const fadeTimeOff = 1000;
int delay = 10;

this is what I have so far (not much):

int ledBrightness3 = 255;
int ledBrightness5 = 0;
int fadeTimeOn = 200;
int fadeTimeOff = 1000;


int d = 10;
void setup()
{

  pinMode(3, OUTPUT); // LED control pin is 3, a PWM capable pin
  pinMode(5, OUTPUT); // LED control pin is 3, a PWM capable pin
}

void loop() {
  for ( int fadeTimeOn ; fadeTimeOn >= 0; fadeTimeOn --)
  {
    analogWrite(3, ledBrightness3);
    ledBrightness3 = ledBrightness3 - 5;
    delay(d);

    analogWrite(5, ledBrightness5);
    ledBrightness5 = ledBrightness5 + 5;
    delay(d);
  }
}

I have to somehow make the time . . .
I have to use only these as my variables . . .

School work?

Yup, school work, the problem is the instructions go one of two ways: either it's them fading in/out at the same time using those fade in/out times, which I can't even figure out haha

Or what I have a feeling it is, and start them at opposite ends using those fade in/out times.

Problem is: in class we just learned the difference between the void setup/loop, and I work when the teacher has office hours. One good thing at least is we're allowed to pull the code from anywhere. I just don't know where to go to be honest. Looking for inspiration or tips or anything you feel might help

More information:
make the time it takes to fade on start with 200 and then fade off with 1000 ?

Yup with loops decreasing by 1 each time and the delay in there

Not sure I understand, but the "map" function may be of help.

Not sure I understand what the 200 and 1000 constants are, but after you are incremented (or decremented) your count, you need to test whether you have reached 255 (or 0) for the count going downward).

ledBrightness3 = ledBrightness3 - 5;

If the count of ledBrightness5 has reached 255, you need to set it back to 0.
If the count of ledBrightness3 has reached 0, you need to reload 255 and continue counting down ....

dan

How do I go about doing that? Sorry really green. Whenever I try with something like this it just keeps counting. ignoring my if statement.

int ledBrightness3 = 255;
int ledBrightness5 = 0;
const int fadeTimeOn = 200;
int fadeTimeOff = 1000;


int d = 50;
void setup()
{
  Serial.begin(9600);
  pinMode(3, OUTPUT); // LED control pin is 3, a PWM capable pin
  pinMode(5, OUTPUT); // LED control pin is 3, a PWM capable pin
}

void loop() {
  for (int fadeTimeOn = 200; fadeTimeOn > 0; fadeTimeOn--) {
    analogWrite(5, ledBrightness5);
    ledBrightness5 = ledBrightness5 + 5;
    //Serial.println(fadeTimeOn);
    Serial.println(ledBrightness5);
    delay(100);
  }
  if (ledBrightness5 == 255); {
    for (int fadeTimeOff = 1000; fadeTimeOff > 1000; fadeTimeOff--) {
      analogWrite(5, ledBrightness5);
      ledBrightness5 = ledBrightness5 - 5;
      Serial.println(fadeTimeOff);
      Serial.println(ledBrightness5);
      delay(1000);
    }
  }
}

im not sure what you are asking (what the teacher wants)

for a start in the first post you say

int const ledBrightness3 = 255;
int const ledBrightness5 = 0;
int const fadeTimeOn = 200;
int const fadeTimeOff = 1000;
int delay = 10;

well const means it can not be changed but in your program you use int ?

next looking at the code

you are saying repeat this "for" loop 200 times

 for (int fadeTimeOn = 200; fadeTimeOn > 0; fadeTimeOn--) {
    analogWrite(5, ledBrightness5);
    ledBrightness5 = ledBrightness5 + 5;
    //Serial.println(fadeTimeOn);
    Serial.println(ledBrightness5);
    delay(100);
  }

theres no exit code based on ledBrightness5 so 200 times you are going to plus 5 which will total
1000

now if you divided ledBrightness5 by 4 before the analogWrite that would give you 250 being sent to the led which would work (you could also use map).

I understand from the code you are trying to fade in at one speed and fade out at a different speed but the minus one per loop just doesn't make sense.

sorry I can not be of much help as I don't understand what you are trying to do.

few other pointers about your code I forgot to add

if (ledBrightness5 == 255); {
}

the ; after a "if" means this will not be run you need to remove it

this line after a "for" loop will not work as the "for" is a loop so it will not exit until finished (unless the if is inside the for loop)

if (ledBrightness5 == 255) {

this line looks wrong also

for (int fadeTimeOff = 1000; fadeTimeOff > 1000; fadeTimeOff--) {