IR SENSOR ERROR

I own an arduino ir sensor (don't know which type) but when i use on of the arduino ir examples to show me the HEX commands it continuously show many HEX signals even when i have not pressed any button and this continues on for 30 secs and i have double checked the code and connections.PLS HELP IS NEEDED AT THE EARLIEST

the code is:

#include <IRremote.h>

int IRPIN = 2;

IRrecv irrecv(IRPIN);

decode_results result;

void setup()
{
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn();
Serial.println("Enabled IRin");
}

void loop()
{
if (irrecv.decode(&result))
{
Serial.println(result.value, HEX);
irrecv.resume();
}
delay(500);
}

don't know which type

Knowing which sensor that you are using is important. Is it one of the 3 terminal IR receiver/decoder uhits? If so, what is the sensor's carrier frequency specification?

it is a bare 3 pin sensor with no specification or number on it.it is completely plain.

The code works fine. I tested the code with my Uno and a similar (no name, no number) generic IR receiver/decoder. It only prints the remote key code when a key is pressed. Can you show a picture of the sensor and how it is wired to your Arduino?

How to post images on the forum.

Read the how to use this forum sticky to see how to properly post code and some advice on how to get the most from the forum.