Teensy 3.2 IRremote Receiving Different IR Codes From Same Remote/Button

Status
Not open for further replies.
Hello everybody,
I have a problem that I always get a different code from the same button.
The IRremote library I have from Teensyduino

The code is:
Code:
#include <IRremote.h>

const int RECV_PIN = 13;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {

    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}
The Serial Output from the same button is:

72F69EF1
DC79B059
D652DCCF
E94488A0
96DA2157
183A6D4C
EDBE796B
9C1EA3B6
FFFFFFFF

I tried to include the other libraries (V2.8.0) but it doesn't work. I just don't understand why it works with my arduino uno but not with the teensy 3.2
Now to the wiring
The teensy is connected to the pc via USB and from a 5v adapter Vin and Gnd from the teensy and from the IR receiver Gnd and Vcc.
The LED from the teensy also flickers when I press a button.

I really need help and I hope you have a solution for this.
Best Regards
 
Pin 13 is the output LED on the T3.2 and doesn't behave quite the same as an ordinary digital input pin. Try using RECV_PIN on pin 14.

BTW. Which IR receiver are you using?

Pete
 
OMG it works with pin 2. I am so thankful to you. i sat on it for hours and did not find this little error.
Thanks again.

Best Regards
 
Can anyone help me to get the IRremote library (2.8.0) running on the teensy 3.2?
The serial monitor shows me nothing with the code.
Not once (Serial.println)
Code:
#include <IRremote.h>
int input_pin = 2;
IRrecv IRR (input_pin);

void setup () {
  Serial.begin (9600);
  IRR.enableIRIn ();
  Serial.print ("IR Ready ... @Pin");
  Serial.println (input_pin);
}

void loop () {
  if (IRR.decode ()) {
  Serial.println (IRR.results.value, HEX);
  IRR.resume ();
 }
}
 
Your code works on a Teensy 2.0 but not on a Teensy 3.2. It dies when the library's enableIRIn function re-enables interrupts after setting up a timer.

Pete
 
The default version of irremote (v2.2.3), which is in the Teensy distribution, works on both T2.0 and T3.2 with a TSSP4038 on Pin 2.
I removed the local version (teensy/libraries/irremote) so that there was no confusion over what was being used.

Pete
 
Status
Not open for further replies.
Back
Top