jumb a code over one time how?

I have made this code to make night and day over my model railroad.

But I witch to jumb a code over, but just ones.

The code i wish to jumb over is this?

  }

  //white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms

  }

Do any one know how to do that?

thanks
mads

But I witch to jumb a code over, but just ones.

The code i wish to jumb over is this?

It is not clear what this means.

If you want to execute that code under some conditions, and not execute it under others, then a simple (for complex) if statement is needed:

if(someCondition)
{
// Do stuff, like the for loop
}

someConsition can be as simple as x == 1 or much more complicated.

What condition(s) must be true to execute that code?

I know I maybe can do this wtih an if, but I do not know how to make an Subtraction so x is equal to y

if (x == 1)
{
  }

  //white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms

  }
}

madshusted:
I know I maybe can do this wtih an if, but I do not know how to make an Subtraction so x is equal to y

if (x == 1)

{
  }

//white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms

}
}

What y? You don't have a y in your code. What do you want to skip over and when (what conditions) do you want to do it?

I need to make an result = value1 - value2;

like x= 2 - 1; so I can use it in the if command...

if (x == 1)
{
  }

  //white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms

  }
}

Why do you want an if-statement? (Also I think you mean "jump, not 'jumb?'")

I need to make an result = value1 - value2;

like x= 2 - 1; so I can use it in the if command...

We need to see your code, and to understand what you want to have happen, under what circumstances.

As I mentioned, the if condition can be complex.

if((value1 - value2) == 1)
{
}

Okay here all my code, and the part I wich to jumb over is the code under the firs //white fluorescent lamp

#define LEDW 9   // the pin for the white fluorescent lamp
#define LEDO 10  // the pin for the Orange fluorescent lamp
#define LEDB 11  // the pin for the blue fluorescent lamp

int i = 0;      // We'll use this to count up and down

void setup() {
  pinMode(LEDW, OUTPUT); // tell Arduino white fluorescent lamp is an output
  pinMode(LEDO, OUTPUT); // tell Arduino Orange fluorescent lamp is an output
  pinMode(LEDB, OUTPUT); // tell Arduino blue fluorescent lamp is an output
}

void loop(){
         

  //Go from day to night
  //Orange fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDO, i);     // set the Orange fluorescent lamp brightness
    delay(10);    // Wait 10ms because analogWrite
                  // is instantaneous and we would
                  // not see any change         
  }
  int x
   x = -10;
   x = x - 1;       // x now contains 9 - rolls over in neg. direction
  if (x==8)
{
    //white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms
}


  }


  //blue fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDB, i);      // set the blue fluorescent lamp brightness
    delay(10);    // Wait 10ms because analogWrite
                  // is instantaneous and we would
                  // not see any change
  }

  //Orange fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDO, i); // set the Orange fluorescent lamp brightness
    delay(10);            // Wait 10ms

  }
  
  //Go from night to day
  //Orange fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDO, i);     // set the Orange fluorescent lamp brightness
    delay(10);  // Wait 10ms because analogWrite
                // is instantaneous and we would
                // not see any change

  }

  //blue fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDB, i); // set the blue fluorescent lamp brightness
    delay(10);           // Wait 10ms

  }

  //white fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDW, i);      // set the white fluorescent lamp brightness
    delay(10);  // Wait 10ms because analogWrite
                  // is instantaneous and we would
                  // not see any change

  }

  //Orange fluorescent lamp

  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDO, i); // set the Orange fluorescent lamp brightness
    delay(10);            // Wait 10ms
    
  }


}

I can´t get x to be 8. I have never trid to work with subtraction

-10 - 1 is - 11

Before posting code, you should at least make sure that it will compile.

  int x
   x = -10;

will not compile.

Then I have more then one problem dont I... need help

Then I have more then one problem dont I

Yes.

  //Go from day to night

The code that follows this unconditionally varies the intensity of the LED from 0 to 255.

The code you want to make conditionally executed does the same, except for varying the value for a different pin.

You have not explained what the condition should be. Rather than trying to explain it in terms of code, explain it in terms of physical conditions - daytime, nighttime, there is a train present, etc.

Then, explain how you (will) know that the condition is, or is not, true. If the code is to be skipped, for instance, when it is daytime, you need to know what time it is or you need to know how light it is.

Once we know what condition must be true, and how to determine whether or not that condition is true, we can help you with the if statement.

Easy easy now it not that complicated...

The code works, but to work perfectly I need to jumb over the code here.
But how to do it I do not know...

I maybe have to use if (conditional) like if (x==y) then execute the code. But the first time (x must not be equal to y) only the second time and forever.
But I also see another problem because the third time(x will again not be equal to y)

I can´t see how to jumb over the code only the first time and then never again.

  }

  //white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms

  }

I can´t see how to jumb over the code only the first time and then never again.

Create a global variable:

boolean skipMe = true;

Then, test that variable, and change it if it is true:

if(skipMe)
{
   skipMe = false;
}
else
{
   // Fade the led here
}

The first time through loop(), skipMe will be true, so the value will be changed to false, and the LED will not fade.

The rest of the times through loop(), skipMe will be false, so the else block, where the LED gets faded, will be executed.

Okay thats sound good PaulS and i put that in my code, but now I have a expected ´}` at end of input

#define LEDW 9   // the pin for the white fluorescent lamp
#define LEDO 10  // the pin for the Orange fluorescent lamp
#define LEDB 11  // the pin for the blue fluorescent lamp

int i = 0;      // We'll use this to count up and down

void setup() {
  pinMode(LEDW, OUTPUT); // tell Arduino white fluorescent lamp is an output
  pinMode(LEDO, OUTPUT); // tell Arduino Orange fluorescent lamp is an output
  pinMode(LEDB, OUTPUT); // tell Arduino blue fluorescent lamp is an output
}

void loop(){
         
    
  //Go from day to night
  //Orange fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDO, i);     // set the Orange fluorescent lamp brightness
    delay(10);    // Wait 10ms because analogWrite
                  // is instantaneous and we would
                  // not see any change         
  }
  
  boolean skipMe = true;
  if(skipMe)
  {
      skipMe = false;
  }
    else
  { 
  //white fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDW, i); // set the white fluorescent lamp brightness
    delay(10);            // Wait 10ms
  {
    
  }

  //blue fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDB, i);      // set the blue fluorescent lamp brightness
    delay(10);    // Wait 10ms because analogWrite
                  // is instantaneous and we would
                  // not see any change
  }

  //Orange fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDO, i); // set the Orange fluorescent lamp brightness
    delay(10);            // Wait 10ms

  }
  
  //Go from night to day
  //Orange fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDO, i);     // set the Orange fluorescent lamp brightness
    delay(10);  // Wait 10ms because analogWrite
                // is instantaneous and we would
                // not see any change

  }

  //blue fluorescent lamp
  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDB, i); // set the blue fluorescent lamp brightness
    delay(10);           // Wait 10ms

  }

  //white fluorescent lamp
  for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in)
    analogWrite(LEDW, i);      // set the white fluorescent lamp brightness
    delay(10);  // Wait 10ms because analogWrite
                  // is instantaneous and we would
                  // not see any change

  }

  //Orange fluorescent lamp

  for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out)

    analogWrite(LEDO, i); // set the Orange fluorescent lamp brightness
    delay(10);            // Wait 10ms
    
  }


}

but now I have a expected ´}` at end of input

If you put each { on a new line, and use Tools + Auto format, you will see exactly where you introduced the curly brace facing the wrong way.

Sorry I don´t get it Nothing is happing when I go to Tools + Auto format...

The compiler is telling you what is wrong.

    delay(10);            // Wait 10ms
  {

That brace is facing the wrong way.

I do not understand that, becaouse it worked before I add the code

if(skipMe)
{
   skipMe = false;
}
else
{
   // Fade the led here
}

You can argue or can fix it. Guess which will make the code work faster.