Last active
August 23, 2020 10:33
-
-
Save RickyCook/d030ce0d5a00eba2d8e62f472d3ee110 to your computer and use it in GitHub Desktop.
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> | |
int IR_RCV_PIN = 2; | |
int IR_SND_PIN = 15; | |
int AMP_RCV_PIN = 36; | |
IRrecv irrecv(IR_RCV_PIN); | |
IRsend irsend; | |
decode_results results; | |
void setup() { | |
Serial.begin(115200); | |
#if defined(SERIAL_USB) || defined(SERIAL_PORT_USBVIRTUAL) | |
delay(2000); | |
#endif | |
// Just to know which program is running on my Arduino | |
Serial.println(F("START " __FILE__ " from " __DATE__)); | |
// In case the interrupt driver crashes on setup, give a clue | |
// to the user what's going on. | |
Serial.println("Enabling IRin"); | |
irrecv.enableIRIn(); // Start the receiver | |
Serial.print(F("Ready to receive IR signals at pin ")); | |
Serial.println(IR_RCV_PIN); | |
Serial.print(F("Ready to send IR signals at pin ")); | |
Serial.println(IR_SND_PIN); | |
} | |
void loop() { | |
if (irrecv.decode(&results)) { | |
Serial.println(results.value, HEX); | |
irrecv.resume(); // Receive the next value | |
} | |
Serial.print('.'); | |
irsend.sendJVC(0xC5B8, 16,0); | |
delay(100); | |
} |
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> | |
int IR_RCV_PIN = 2; | |
int IR_SND_PIN = 15; | |
int AMP_RCV_PIN = 36; | |
void setup() { | |
pinMode(IR_SND_PIN, OUTPUT); // set pin to input | |
digitalWrite(IR_SND_PIN, HIGH); // turn on pullup resistors | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment