arduino IR blaster sketch problems


Recently my tv's remote broke down so i thought let's make a IR blaster from an arduino, I wired everything up and i used this code:

the first problem was that the IR blaster included in the arduino package didn't work so i had to cut the IR blaster out of my old remote

I was surprised to see the IR led light up (through a camera) and to see the tv respond :D Now here is the problem, this code sends a signal every 20 seconds causing the tv to go on and off every 20 seconds now I want it to send the signal only when i press a button, I tried many different codes and one seemed good but the tv wouldn't respond

is there anyone who can change the code so it only sends something throught the ir blaster when i press a button?



Why don’t you just hide the remote under a cushion?

What do you mean? The arduino is not supposed to turn the tv on and off every 20 seconds, the only thing it should do is send a on/off signal to the tv when i press a button but i don't know how to remove the code that makes it turn on/off every 20 seconds and add the button code

I created a new code: the LED seems to respond to the button press but now i lost the ability to control the TV, it didn't respond at all i just can't figure this out