infrared receiver help

i am making a remote that controls a stepper motor and i beleive im doing something wrong trying to decode the hex,

#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)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}

im just trying to get the hex codes for my remote for now but nothing shows up in serial monitor please say any suggestions.

I assume you have your serial monitor set to 9600.
If not you can do it in the bottom right hand side of the Serial Monitor window.

What receiver are you using?
How have you wired the receiver?

LarryD:
What receiver are you using?
How have you wired the receiver?

I have a Keyes infrared receiver modual and it's wired to 5v ground and I've been changing the pins and the PIN number on the code to see if it would work but mostly 11

Your sketch works 100% with a NEC remote and a TSOP4838 receiver.

Hi,
I think the Keyes receiver is a small module! So that don't tell us what the actual device is, what does it say, how is it marked?? Most seem to work with the Sony code table. Also things like the TSOP series are not all are 38KHz!

I used a Vishay TSOP2438, see Vishay website for data, here's some test code, that I found useful..

/*
 * 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)) {
    Serial.println(byte(results.value));
    delay(500);
    irrecv.resume(); // Receive the next value
  }
}/code]

Hope it helps, regards.

Mel.

Cactusface:
Hi,
I think the Keyes receiver is a small module! So that don't tell us what the actual device is, what does it say, how is it marked?? Most seem to work with the Sony code table. Also things like the TSOP series are not all are 38KHz!

I used a Vishay TSOP2438, see Vishay website for data, here's some test code, that I found useful..

/*
  • 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)) {
    Serial.println(byte(results.value));
    delay(500);
    irrecv.resume(); // Receive the next value
  }
}/code]

Hope it helps, regards.

Mel.

im still not getting any hesults for this but i would like to get the hex codes because this is the first step in my project but its not working still and im wondering if its the receiver if its fried or something but thanks

Like I said, your sketch works here.
It must be in your hardware.