Error Message "expected primary-expression"

I am trying to write the code for a machine that will shut my lights off when I push the "FUNC/STOP" button on the remote. I get the error message "expected primary-expression before 'irrecv'". Here is my code.

#include "IRremote.h"
#include "Servo.h"
const int servoPin = 11;
int pos = 0;

Servo servo1;


IRrecv irrecv(receiver);
decode_results results;

Here is my code.

Did you forget to post most of it ?

You need to post all the code, all you have shown us is a few lines at the top of the program.

I am not completely finished writing it yet but here is what I have so far.

#include "IRremote.h"
#include "Servo.h"
const int servoPin = 11;
int pos = 0;

Servo servo1


IRrecv irrecv(receiver);
decode_results results;

void translateIR() {

  switch(results.value){
    case 0xFFE21D: Serial.println("FUNC/STOP"); break;
  
  default: 
    Serial.print(" That Didn't Work!!!  ");
    Serial.println(results.value);

  }

}

void setup(){
  Serial.begin(9600);
  Serial.println("IR Receiver Button Decode"); 
  irrecv.enableIRIn();
  pinMode(9, INPUT);
  pinMode(11, OUTPUT);
  servo1.attach(11);
}

void loop(){
  
}
Servo servo1

Something missing, perhaps ?

@UKHeliBob, it should be "Servo servo1;". Sorry, is that what your talking about?

Yes

However, it is not the only error.

What is receiver ?

Well, its easy to check for yourself.

If you do a Google serace on;

'arduino servo reference'

You will be directed to a reference page with links to examples of how to use the Servo command.

Ok. But what about the error message "expected primary-expression before 'irrecv'"? It is talking about the line that says "IRrecv irrecv(receiver);"

#include "IRremote.h"
#include "Servo.h"
const int servoPin = 11;
int pos = 0;

Servo servo1


IRrecv irrecv(receiver);
decode_results results;

void translateIR() {

  switch(results.value){
    case 0xFFE21D: Serial.println("FUNC/STOP"); break;
  
  default: 
    Serial.print(" That Didn't Work!!!  ");
    Serial.println(results.value);

  }

}

void setup(){
  Serial.begin(9600);
  Serial.println("IR Receiver Button Decode"); 
  irrecv.enableIRIn();
  pinMode(9, INPUT);
  pinMode(11, OUTPUT);
  servo1.attach(11);
}

void loop(){
  
}

Have you fixed the problem with the Servo object ?

Yes but it now says "'receiver' was not declared in this scope". It is still talking about the same line.

No

Where is receiver declared ?

What do you mean?

Your code has this in it

IRrecv irrecv(receiver);

What is receiver and how does the program know what it is and where to find it ?