Help with LEDs on model railway project

{
    int brightness = map(modelClock.hours, 2, 10, 0, 15);
    int brightness2 = map(modelClock.hours, 14, 20, 15, 0);


  if (modelClock.hours==00)
{
  analogWrite(LED1, 0);
}
if (modelClock.hours >=2)    
    {
      analogWrite(LED1, brightness);
    }
    if (modelClock.hours >= 14);
    {
      analogWrite(LED1, brightness2);
    }
  }```

No joy..

Lose the semicolon:

    if (modelClock.hours >= 14);

didn't do it either..

if (modelClock.hours == 00)
{
  analogWrite(LED1, 0);
}
if (modelClock.hours >= 02 || < = 9 )    
    {
      analogWrite(LED1, brightness);
    }
    if (modelClock.hours == 10)
    {
      analogWrite(LED1, 15);
    }
if (modelClock.hours >=14 || < = 20)
{
  analogWrite(LED1, brightness2);
}
  
  }

Do the hours to trigger need to be in a range like this? This won't let me up load as there is a problem with it, but for demo purposes

Oops

This:

if (modelClock.hours >= 02 || < = 9 )   

Should probably be:

if (modelClock.hours >= 2 && modelClock.hours<= 9 )   

Same pattern for the other one too.

This seems to have done the trick! Thank you!

So guess who is isolating with covid and has some spare time for arduino learning! :joy:

I installed some rgb led strips as was suggested above and am trying to figure out the best way to get them into my code to do sunrise and sunset.

I have been having fun with fastled.h so I have them wired correctly... Not as simple as mapping the other leds was it seems though...

I did find this example, but can't figure out how to adjust the colours as they're a bit extreme. The palettes I could do with help with. How to do the opposite of this ie sunset Then how to trigger it all from my modelclock

I use Fastled to get the .show() function but I put the values in the led array for red, green, blue and adjust them by value. One of the fastled source files has a big table of color names and values if you want names.