Error messages in code

I have some code and I don’t know what is wrong with it.

int ir_pin = 2;		//Sensor pin 1 wired through a 220 ohm resistor		
int led_pin = 13;        // built in LED

int ledLEFT = 12;
int ledFORWARD = 11;
int ledBACK = 10;
int ledRIGHT = 8;
				
int debug = 1;				  
int start_bit = 2000;			
int bin_1 = 1000;				
int bin_0 = 400;				   


void setup() {
 pinMode(led_pin, OUTPUT);		
 pinMode(ir_pin, INPUT);
 
 pinMode(ledLEFT, OUTPUT);
 pinMode(ledFORWARD, OUTPUT);
 pinMode(ledBACK, OUTPUT);
 pinMode(ledRIGHT, OUTPUT);
 
 digitalWrite(led_pin, LOW);	
 
 Serial.begin(9600);
}

void loop()
{
   int key = getIRKey();
   if (key != -1)
   {
     Serial.print("Key Received: ");
     Serial.println(key);
   }
   
   switch (key)
   {
     case 16:                      // left + forward
       LF();
       break;
       
     //case xxxx:                    // forward
     //  F();
     //  break;
       
     case 1040:                    // right + forward
       RF();
       break;
       
     case 2064:                    // left + back
       LB();
       break;
       
     case 528:                     // back
       B();
       break;
       
     //case xxxx:                    // right + back
       RB();
       break;
       
     //case xxxx:                    // stop
     //  S();
     //  break;
       
     case -1:                      // no key received
       break;
   }
}
 
  void LF()                          //To go left + forward.
  {                           
    digitalWrite(ledLEFT, HIGH);
    digitalWrite(ledFORWARD, HIGH);
    digitalWrite(ledBACK, LOW);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
    digitalWrite(ledFORWARD, LOW);
  }
  
  void F()                     //To go forward.      
  {
     digitalWrite(ledLEFT, LOW);
     digitalWrite(ledFORWARD, HIGH); 
     digitalWrite(ledBACK, LOW);
     digitalWrite(ledRIGHT, LOW);
     delay(100);
     digitalWrite(ledFORWARD, LOW);
  }
  
  void RF()                      //To go right + forward.
  {
     digitalWrite(ledLEFT, LOW);
     digitalWrite(ledFORWARD, HIGH);
     digitalWrite(ledBACK, LOW); 
     digitalWrite(ledRIGHT, HIGH);
     delay(100);
     digitalWrite(ledFORWARD, LOW);
  }
  
  void LB() {                         //To go left + back.                         
    digitalWrite(ledLEFT, HIGH);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, HIGH);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
    digitalWrite(ledBACK, LOW);
  }
  
  void B() {                          //To go back. 
    digitalWrite(ledLEFT, LOW);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, HIGH);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
    digitalWrite(ledBACK, LOW);
  }
  
  void RB() {                         //To go right + back. 
    digitalWrite(ledLEFT, LOW);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, HIGH);
    digitalWrite(ledRIGHT, HIGH);
    delay(100);
    digitalWrite(ledBACK, LOW);
  }
  
  void S() {                         //To stop. 
    digitalWrite(ledLEFT, LOW);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, LOW);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
  }


void getIRKey() {
  int data[12];
  
  digitalWrite(led_pin, HIGH);     
  while(pulseIn(ir_pin, LOW) < 2200) {
  }
 
 data[0] = pulseIn(ir_pin, LOW);	 
 data[1] = pulseIn(ir_pin, LOW);
 data[2] = pulseIn(ir_pin, LOW);
 data[3] = pulseIn(ir_pin, LOW);
 data[4] = pulseIn(ir_pin, LOW);
 data[5] = pulseIn(ir_pin, LOW);
 data[6] = pulseIn(ir_pin, LOW);
 data[7] = pulseIn(ir_pin, LOW);
 data[8] = pulseIn(ir_pin, LOW);
 data[9] = pulseIn(ir_pin, LOW);
 data[10] = pulseIn(ir_pin, LOW);
 data[11] = pulseIn(ir_pin, LOW);
 
 digitalWrite(led_pin, LOW);

 if (debug == 1) {
 }
 
 for (int i=0; i<=11; i++) {		    
   if (debug == 1) {  
   }
   
   if(data[i] > bin_1) {		    
	 data[i] = 1;
        }
   else {
	 if(data[i] > bin_0) {	     
	   data[i] = 0; }
         else {
	   data[i] = 2;			  
	 }
   }
 }

 for (int i = 0; i <= 11; i++)
 {		     
   if (data[i] > 1)
   {
     return -1;				
   }
 }

 int result = 0;
 int seed = 1;
 for(int i = 11; i >= 0; i--)
 {		  
   if(data[i] == 1)
   {
     result += seed;
   }
   seed = seed * 2;
 } 
 return result;
}

Here are the errors:

Something1:-1: error: expected unqualified-id before 'reinterpret_cast'
Something1:-1: error: expected `)' before 'reinterpret_cast'
Something1:-1: error: expected unqualified-id before ')' token
Something1.cpp: In function 'void loop()':
Something1:30: error: void value not ignored as it ought to be
Something1.cpp: At global scope:
Something1:82: error: expected unqualified-id before 'reinterpret_cast'
Something1:82: error: expected `)' before 'reinterpret_cast'
Something1:82: error: expected unqualified-id before ')' token
Something1.cpp: In function 'void getIRKey()':
Something1:183: error: return-statement with a value, in function returning 'void'
Something1:197: error: return-statement with a value, in function returning 'void'

I see one error: getIRKey() is declared void. That means that it cannot return a value. You are trying to force that void function to return an int. You should change "void getIRKey()" to "int getIRKey()".

It doesn't like this line:void F()

From the release notes for the Arduino IDE, version 1.0.1:

Support has been added for printing strings stored in flash (program memory) rather than RAM. Wrap double-quoted strings in F() to indicate that they should be stored in flash, e.g. Serial.print(F("hello world")).

The code compiles under 0.22. Change the name of the function to something else, and it'll compile under 1.0.1.

void RB() {                         //To go right + back.

If you called the function something sensible, you wouldn't have to comment it. If I see "RB()" in the middle of some code, I don't want to have to go off to th function definition to find out exactly what it does, the name should give me a big clue. Avoid using capital letters when naming functions or variables; C style rules suggest you use capitals only for #defines.

Got it to work with no errors. Thanks for the help (especially tmd3):

int ir_pin = 2;		//Sensor pin 1 wired through a 220 ohm resistor		
int led_pin = 13;        // built in LED

int ledLEFT = 12;
int ledFORWARD = 11;
int ledBACK = 10;
int ledRIGHT = 8;
				
int debug = 1;				  
int start_bit = 2000;			
int bin_1 = 1000;				
int bin_0 = 400;				   


void setup() {
 pinMode(led_pin, OUTPUT);		
 pinMode(ir_pin, INPUT);
 
 pinMode(ledLEFT, OUTPUT);
 pinMode(ledFORWARD, OUTPUT);
 pinMode(ledBACK, OUTPUT);
 pinMode(ledRIGHT, OUTPUT);
 
 digitalWrite(led_pin, LOW);	
 
 Serial.begin(9600);
}

void loop()
{
   int key = getIRKey();
   if (key != -1)
   {
     Serial.print("Key Received: ");
     Serial.println(key);
   }
   
   switch (key)
   {
     case 16:                      // left + forward
       LF();
       break;
       
     //case xxxx:                    // forward
     //  f();
     //  break;
       
     case 1040:                    // right + forward
       RF();
       break;
       
     case 2064:                    // left + back
       LB();
       break;
       
     case 528:                     // back
       B();
       break;
       
     //case xxxx:                    // right + back
       RB();
       break;
       
     //case xxxx:                    // stop
     //  S();
     //  break;
       
     case -1:                      // no key received
       break;
   }
}
 
  void LF()                          //To go left + forward.
  {                           
    digitalWrite(ledLEFT, HIGH);
    digitalWrite(ledFORWARD, HIGH);
    digitalWrite(ledBACK, LOW);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
    digitalWrite(ledFORWARD, LOW);
  }
  
  void f()                     //To go forward.      
  {
     digitalWrite(ledLEFT, LOW);
     digitalWrite(ledFORWARD, HIGH); 
     digitalWrite(ledBACK, LOW);
     digitalWrite(ledRIGHT, LOW);
     delay(100);
     digitalWrite(ledFORWARD, LOW);
  }
  
  void RF()                      //To go right + forward.
  {
     digitalWrite(ledLEFT, LOW);
     digitalWrite(ledFORWARD, HIGH);
     digitalWrite(ledBACK, LOW); 
     digitalWrite(ledRIGHT, HIGH);
     delay(100);
     digitalWrite(ledFORWARD, LOW);
  }
  
  void LB() {                         //To go left + back.                         
    digitalWrite(ledLEFT, HIGH);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, HIGH);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
    digitalWrite(ledBACK, LOW);
  }
  
  void B() {                          //To go back. 
    digitalWrite(ledLEFT, LOW);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, HIGH);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
    digitalWrite(ledBACK, LOW);
  }
  
  void RB() {                         //To go right + back. 
    digitalWrite(ledLEFT, LOW);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, HIGH);
    digitalWrite(ledRIGHT, HIGH);
    delay(100);
    digitalWrite(ledBACK, LOW);
  }
  
  void S() {                         //To stop. 
    digitalWrite(ledLEFT, LOW);
    digitalWrite(ledFORWARD, LOW); 
    digitalWrite(ledBACK, LOW);
    digitalWrite(ledRIGHT, LOW);
    delay(100);
  }


int getIRKey() {
  int data[12];
  
  digitalWrite(led_pin, HIGH);     
  while(pulseIn(ir_pin, LOW) < 2200) {
  }
 
 data[0] = pulseIn(ir_pin, LOW);	 
 data[1] = pulseIn(ir_pin, LOW);
 data[2] = pulseIn(ir_pin, LOW);
 data[3] = pulseIn(ir_pin, LOW);
 data[4] = pulseIn(ir_pin, LOW);
 data[5] = pulseIn(ir_pin, LOW);
 data[6] = pulseIn(ir_pin, LOW);
 data[7] = pulseIn(ir_pin, LOW);
 data[8] = pulseIn(ir_pin, LOW);
 data[9] = pulseIn(ir_pin, LOW);
 data[10] = pulseIn(ir_pin, LOW);
 data[11] = pulseIn(ir_pin, LOW);
 
 digitalWrite(led_pin, LOW);

 if (debug == 1) {
 }
 
 for (int i=0; i<=11; i++) {		    
   if (debug == 1) {  
   }
   
   if(data[i] > bin_1) {		    
	 data[i] = 1;
        }
   else {
	 if(data[i] > bin_0) {	     
	   data[i] = 0; }
         else {
	   data[i] = 2;			  
	 }
   }
 }

 for (int i = 0; i <= 11; i++)
 {		     
   if (data[i] > 1)
   {
     return -1;				
   }
 }

 int result = 0;
 int seed = 1;
 for(int i = 11; i >= 0; i--)
 {		  
   if(data[i] == 1)
   {
     result += seed;
   }
   seed = seed * 2;
 } 
 return result;
}

in “getIRKey” you have:

  while(pulseIn(ir_pin, LOW) < 2200) {
  }
 
 data[0] = pulseIn(ir_pin, LOW);

That while() loop doesn’t do anything. Is that what you intended? If so, it would be better to write it as:
while(pulseIn(ir_pin, LOW) < 2200);

Well, This really is CallMeShady 's code http://arduino.cc/forum/index.php/topic,103395.msg878690.html#msg878690, however, I tried fixing up his/her code and I was having problems with errors