Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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