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.
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.