Understanding simple code

Hello again I feel like I have been catching on pretty good for a beginner.
I have used other codes and made them my own but I like to understand what I am doing. I just have a couple questions and am hoping to get a better understanding. From a code I pulled offline I used it for my project. The coder was much better than I am so I want to know what and why he did seitan things.

  1. if (isPressed) {
    led5.on();
    } else {
    led5.off();
    in this I understand if/else but I’ve never seen on/off? I looked into reference guides but couldn’t find it. Can someone help?
  2. timer.setInterval(500L,
    In this I am using a simple timer library but I don’t understand the L in the 500L?
    Thanks :o

Take a look at the rest of the code that you don't show - look at the definitions for led5

Thank you gpsmikey
There is not much in the definition for that it is from another app.
When I open my IDE go to void loop and type on it turns orange. And when I type off it does not. I was thinking at least with the on command the IDE has to recognize something for it to turn orange. Am I right? As new as I am if there were no colors I would be in more trouble.

Ok I wrote that if I type on in the IDE it turns orange, But I discovered it does that with the ESP8266 board selected and not the UNO?

The led that you're talking about is an instance of a certain class. You need that class; it's usually found in a dedicated h and cpp file

By the way, color does not mean anything; better to ignore it.

I'm not much of a CPP programmer, but the below demonstrates (without using dedicated files)

class TheLed
{
  private:
    byte _pinNo;

  public:
    /*
      constructor; takes the pin number as input
    */
    TheLed(byte pin)
    {
      _pinNo = pin;
    }
    /*
      begin; initializes the pin mode
    */
    void begin()
    {
      pinMode(_pinNo, OUTPUT);
    }
    /*
      switch led on
    */
    void on()
    {
      digitalWrite(_pinNo, HIGH);
    }
    /*
      switch led off
    */
    void off()
    {
      digitalWrite(_pinNo, LOW);
    }

};

TheLed led13(13);

void setup() {
  Serial.begin(9600);
  led13.begin();
}

void loop()
{
  led13.on();
  delay(1000);
  led13.off();
  delay(1000);

}

By the way, the L in 500L tells the compiler that you're passing a long integer to the function.

THX sterretje
Ill play with this a while.