#include IRrecv receive_ir( P2_4 ); void setup( void ) { Serial.begin( 9600 ); receive_ir.enableIRIn(); pinMode( RED_LED, OUTPUT ); } const char *types[] = { "UNKNOWN", "ERROR", "NEC", "SONY", "RC5", "RC6", "DISH", "SHARP" }; void loop( void ) { decode_results results; if( receive_ir.decode( &results ) ) { digitalWrite( RED_LED, HIGH ); Serial.print( "Type is " ); Serial.print( types[ results.decode_type + 1 ] ); Serial.print( ": Value is " ); Serial.println( results.value ); digitalWrite( RED_LED, LOW ); receive_ir.resume(); } }