Control remoto IR con Arduino

Ojo! este codigo y la libreria funcionan con el IDE 0022.

*************** ESTA ES LA SOLUCION PARA QUE FUNCIONE CON IDE 1.0.1 *******

go to where you installed arduino IDE, and go to the IRremote library folder and find IRremoteInt.h ex "C:\Users\Robert\Desktop\arduino-1.0\libraries\IRremote\IRremoteInt.h"

towards the top of this text file you should see something like:
Code:
#include "WProgram.h"
replace it with:
Code:
#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
#else
  #include "WProgram.h"
  #include <pins_arduino.h>
#endif

teda... it works

Fuente: http://arduino.cc/forum/index.php?action=printpage;topic=96719.0
 ***************************************************************************

http://www.e-shore.com.my/homepage/all-projects/193-ir-remote-control-mobile-robot.html#oogleto:http://www.e-shore.com.my/homepage/images/mo/100511_0333_IRRemoteCon7.png



/*
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {


  if (irrecv.decode(&results)) {
    if(results.value==0xFF30CF)
    {
      Serial.println("NUMERO 1");
    } else
    {
      Serial.println(results.value, HEX);
    }
    //Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}

No hay comentarios:

Publicar un comentario