IRRemote library with generic remotes

Hey guys, I'm a bit troubled on how to do this, I've been trying for the last hour or so to figure out how to use the IRRemote library. I have a cheap LED lightbulb with a generic IR remote that I can control the colors with. I've got the output of the remote, I think? using below I got "F7C03F" but that isn't in proper 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
    
  }
}

So I used a text->hex converter and got "463743303346" which I rebroadcasted toward my bulb using:

#include <IRremote.h>

IRsend irsend;

void setup()
{
  Serial.begin(9600);
}

void loop() {

      irsend.sendNEC(463743303346, 12); // Sony TV power code
      delay(40);
  
}

but my bulb never turns on. My receiver is connected properly to port 11, GND +5V, and my transmitter is Port 2, +5V, and GND. Any ideas why my code wouldn't be working?

EDIT: my IR transmitter is a 3-pin, does that matter? When I send a digitalWrite high to the pin, the LED on the transmitter turns on.

I've got the output of the remote, I think? using below I got "F7C03F" but that isn't in proper hex.

You say that because YOU didn't print the leading 0x? Or do you have some other reason for saying that?

C0FFEE can be a hex number why can't F7C03F

PaulS:
You say that because YOU didn't print the leading 0x? Or do you have some other reason for saying that?

Ah, cause I didn't know that. thanks! Let me try it.

EDIT:
I tried

 irsend.sendNEC(0xF7C03F, 6); // Sony TV power code
      delay(40);

but the darn LED on the IR transmitter didn't light up, what else could it be. I'm going to try to set the pin to high or something.

update, still not working. Hmm

Why are you assuming that sendNEC() is the correct method to use?

PaulS:
Why are you assuming that sendNEC() is the correct method to use?

I think it said thats what it was. I think the only other way is raw, which I don't understand :()

Here are the ones I bought, http://www.ebay.com/itm/like/201236914129?lpid=82&chn=ps.

128keaton:
So I used a text->hex converter and got "463743303346" which I rebroadcasted toward my bulb using:

....

That's 6BF9413EB2 in hex. That won't fit in a long int.

Ok, hmm. I tried using a sketch using raw, but the data light never blinked on the transmitter. I've tried NEC and HEX as reported by the program instead of doing manual conversion.

Ok, hmm. I tried using a sketch using raw, but the data light never blinked on the transmitter. I've tried NEC and HEX as reported by the program instead of doing manual conversion.

Hi, Im trying the same thing, with what I believe is the same LED bulb. This is the sketch I used to turn my LED bulb on and off every second.

#include <IRremote.h>

IRsend irsend;

void setup()
{
  Serial.begin(9600);
}

void loop() {

      irsend.sendNEC(F7C03F, 32);
      delay(1000);
      irsend.sendNEC(F740BF, 32);
      delay(1000);
}

I believe your problem is that you've put 12 after the ir code, where I believe with NEC you have to use 32.
Hope this helps! :slight_smile: