Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ## https://github.com/z3t0/Arduino-IRremote/ ##
- // IR Transmitter
- #include <IRremote.h>
- IRsend irsend;
- void setup()
- {
- delay(200);
- irsend.sendNEC(volume_down, 32);
- }
- void loop()
- {
- }
- // IR Receiver
- #include <IRremote.h>
- const int RECV_PIN = 7;
- IRrecv irrecv(RECV_PIN);
- decode_results results;
- void setup(){
- Serial.begin(9600);
- irrecv.enableIRIn();
- irrecv.blink13(true);
- }
- void loop(){
- delay(5000); //5 second delay between each signal burst
- if (irrecv.decode(&results)) {
- if (results.decode_type == NEC) {
- Serial.print("NEC: ");
- } else if (results.decode_type == SONY) {
- Serial.print("SONY: ");
- } else if (results.decode_type == RC5) {
- Serial.print("RC5: ");
- } else if (results.decode_type == RC6) {
- Serial.print("RC6: ");
- } else if (results.decode_type == UNKNOWN) {
- Serial.print("UNKNOWN: ");
- }
- Serial.println(results.value, HEX);
- irrecv.resume(); // Receive the next value
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment