Created
January 12, 2016 03:01
Arduino sketch that sends an IR signal to turn Samsung TV on/off every time it receives a byte (any byte) using serial connection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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