I want so controll my TV with my arduino. I know that the HEX code for the power button:0xFD020707. I got a IR sender module: S: Digital3, -:GND, +:5v This is my code i tryed:
It is not doing anything on the TV and connected a reciver but its just telling 0x0(when hitting a button on the remote it tells the HEX code)
The TV to turn on or the reciver to see the signal
``
#include <IRremote.h>
IRsend irsender;
void setup() {
Serial.begin(9600);
pinMode(12, OUTPUT);
}
void loop() {
delay(2000);
digitalWrite(12, HIGH);
//Power//
irsender.IRsendNEC(0xFD020707, 32); //Power Code
Serial.println("Power");
delay(2000);
digitalWrite(12, LOW);
}
``
You are missing the call to
irsender.beginin setup. Look at the example codes from the IR library that you are using and see how they call it.