Good afternoon people, I'm having a seriously problem with arduino IR Transmissor, I've a LG Television and I want to turn on/off it, I got the receiver and got the ON/OFF code as shown below:
Encoding : NEC
Code : 20DFC03F (32 bits)
Timing[67]:
+9050, -4450 + 550, - 550 + 600, - 550 + 550, -1700
+ 550, - 600 + 550, - 550 + 600, - 550 + 550, - 550
+ 600, - 550 + 600, -1650 + 600, -1650 + 600, - 550
+ 550, -1700 + 550, -1700 + 550, -1700 + 550, -1700
+ 550, -1700 + 550, -1700 + 550, -1700 + 550, - 550
+ 600, - 550 + 600, - 550 + 550, - 550 + 600, - 550
+ 600, - 550 + 550, - 550 + 600, - 550 + 550, -1700
+ 600, -1650 + 600, -1650 + 600, -1650 + 600, -1650
+ 600, -1650 + 600
unsigned int rawData[67] = {9050,4450, 550,550, 600,550, 550,1700, 550,600, 550,550, 600,550, 550,550, 600,550, 600,1650, 600,1650, 600,550, 550,1700, 550,1700, 550,1700, 550,1700, 550,1700, 550,1700, 550,1700, 550,550, 600,550, 600,550, 550,550, 600,550, 600,550, 550,550, 600,550, 550,1700, 600,1650, 600,1650, 600,1650, 600,1650, 600,1650, 600}; // NEC 20DFC03F
unsigned int data = 0x20DFC03F;
So, the code to turn it on is: 20DFC03F, it have 32 bits and the decodification is NEC, then I put my IR Led in pins:
Positive -> (Digital Pin 3 + 4.7kOhms resistor)
Negative -> (Ground)
And I used the code:
#include <IRremote.h>
IRsend irsend;
void setup()
{
Serial.begin(9600);
}
void loop() {
irsend.sendNEC(0x20DF10EF,32);
delay(3000);
}
So, it should turn the television on and off every 3 seconds BUT it doesn't, the pins seens to be ok (I use ATMega2560 board), the code seens to be ok, I got the library in correct place...
I made some testes to see if the led was working, when I use output,HIGH or output,LOW, I can see with my camera the led working but with the code above it doesn't blink (I don't know if I it blinks fast or if the code is not working)
My question is, what's wrong with my code/schematic? Did I made a mistake in the code? Or in pin usage?
Thanks a lot! Heitor.