Control Arduino with Universal Remote

Had same compiler problems as Jacobson and others.

Finally got this working on Duemilanove with ATMEGA328 and using Arduino 16.

Secret was to add: #include <WProgram.h> to main sketch like this:

// look for IR codes and print them as they are received

#include <WProgram.h>
#include <NECIRrcv.h>
#define IRPIN 4    // pin that IR detector is connected to

NECIRrcv ir(IRPIN) ;

void setup()
{
  Serial.begin(9600) ;
  Serial.println("NEC IR code reception") ;
  ir.begin() ;
}

void loop()
{
  unsigned long ircode ;
  
  while (ir.available()) {
    ircode = ir.read() ;
    Serial.print("got code: 0x") ;
    Serial.println(ircode,HEX) ;
  }
}

Works like a charm!

Regards to all,
Mark
Ottawa, Canada.