Skip to content

Instantly share code, notes, and snippets.

@Exchizz
Created July 2, 2016 10:40
Show Gist options
  • Save Exchizz/bd419c17b27caa19f6098e88e965e822 to your computer and use it in GitHub Desktop.
Save Exchizz/bd419c17b27caa19f6098e88e965e822 to your computer and use it in GitHub Desktop.
/*
* IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
* An IR LED must be connected to Arduino PWM pin 3.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#include <IRremote.h>
IRsend irsend;
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
if (Serial.available() > 0) {
// read the incoming byte:
byte incomingByte = Serial.read();
if (incomingByte == '1'){
digitalWrite(13, HIGH);
for (int i = 0; i < 3; i++) {
//irsend.sendSony(0xC81, 12); // volume down SONY amplifier
//irsend.sendSony(0x481,12); // volume up SONY amplifier
//irsend.sendSony(0x7620,15); // Power amplifier off
irsend.sendSony(0xA41,12); // Amp CD
//irsend.sendSony(0xBE1, 12); // Amp airplay
delay(40);
}
}
if(incomingByte == '0'){
digitalWrite(13, LOW);
for (int i = 0; i < 3; i++) {
//irsend.sendSony(0xC81, 12); // volume down SONY amplifier
//irsend.sendSony(0x481,12); // volume up SONY amplifier
irsend.sendSony(0x7620,15); // Power amplifier off
//irsend.sendSony(0xA41,12); // Amp CD
//irsend.sendSony(0xBE1, 12); // Amp airplay
delay(40);
}
}
}
delay(500); //5 second delay between each signal burst
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment