Hi I am new to aurdino project I have one TV in home, I want to send the same code every 1 sec to tv receiver its smart TV can anybody suggest the program pls , if any help got its appritiated
Start by getting the signal to send once. You should be able to easily adapt one of the example sketches that come with the IRremote library for this. If you haven't already, you can install the IRremote library by following these instructions:
- Sketch > Include Library > Manage Libraries
- Wait for the download to finish.
- In the "Filter your search..." field, type "irremote".
- Press Enter.
- From the list of search results, click on "IRremote by shirriff".
- Click the "Install" button.
- Wait for the installation to finish.
- Click the "Close" button.
- You will now find the list of example sketches for the library under File > Examples > IRremote.
Once you have been able to send the code once you can then update the sketch to send it every 1 second. The naive way to do this is by using delay(), as demonstrated in the Blink tutorial:
the problem with delay() is that it blocks the Arduino board from doing anything else. So if you wanted to control it by pressing a button, it would miss the button presses while the delay was running. The better way to do this is using millis(), as demonstrated by the BlinkWithoutDelay tutorial:
You should be able to easily adapt either of those sketches to send the IR code instead of blinking the LED.