Skip to content

Instantly share code, notes, and snippets.

@Ekus
Created January 12, 2016 03:01
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Ekus/92842e60e8a3f53f38d3 to your computer and use it in GitHub Desktop.
Arduino sketch that sends an IR signal to turn Samsung TV on/off every time it receives a byte (any byte) using serial connection.
#include <IRremote.h>
IRsend irsend;
//samsung tv power on/off
unsigned int S_pwr[68]={4600,4350,700,1550,650,1550,650,1600,650,450,650,450,650,450,650,450,700,400,700,1550,650,1550,650,1600,650,450,650,450,650,450,700,450,650,450,650,450,650,1550,700,450,650,450,650,450,650,450,650,450,700,400,650,1600,650,450,650,1550,650,1600,650,1550,650,1550,700,1550,650,1550,650};
void setup()
{
Serial.begin(9600);
}
void loop() {
if (Serial.read() != -1) {
irsend.sendRaw(S_pwr,68,38);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment