I'm trying to put together a specialized tv remote using an Arduino Leonardo, my project requires HID capabilities hence the Leonardo. At the moment I'm trying to figure out the signals I am going to be sending to the tv so I have an IR receiver.
The receiver is in a breadboard,
ground -> A1
VCC in A3
output in A5.
From the breadboard I have jumpers going
B1 -> Leo. ground
B3 -> Leo. 5v
B5 -> Leo. 13
Then I have the following sketch. When I shoot a tv remote into the receiver, nothing gets displayed in the serial monitor. Does anyone have any ideas what I'm doing wrong? I know every tutorial I see uses an Arduino Uno, is that the problem? Can the Leonardo can't do this?
// Include IR Remote Library by Ken Shirriff
#include <IRremote.h>
// Define sensor pin
const int RECV_PIN = 13;
// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
// Serial Monitor @ 9600 baud
Serial.begin(9600);
// Enable the IR Receiver
irrecv.enableIRIn();
}
void loop(){
if (irrecv.decode(&results)){
Serial.println(results.value, HEX);
switch (results.decode_type){
case NEC:
Serial.println("NEC");
break;
case SONY:
Serial.println("SONY");
break;
case RC5:
Serial.println("RC5");
break;
case RC6:
Serial.println("RC6");
break;
case DISH:
Serial.println("DISH");
break;
case SHARP:
Serial.println("SHARP");
break;
case JVC:
Serial.println("JVC");
break;
/*case SANYO:
Serial.println("SANYO");
break;
case MITSUBISHI:
Serial.println("MITSUBISHI");
break;*/
case SAMSUNG:
Serial.println("SAMSUNG");
break;
case LG:
Serial.println("LG");
break;
case WHYNTER:
Serial.println("WHYNTER");
break;
/*case AIWA_RC_T501:
Serial.println("AIWA_RC_T501");
break;*/
case PANASONIC:
Serial.println("PANASONIC");
break;
case DENON:
Serial.println("DENON");
break;
default:
case UNKNOWN:
Serial.println("UNKNOWN");
break;
}
irrecv.resume();
}
}