When run this code and then press buttons on my remote I only get a 0 no matter what button I push.
/*
IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
An IR detector/demodulator must be connected to the input RECV_PIN.
Version 0.1 July, 2009
Copyright 2009 Ken Shirriff
http://arcfn.com
*/
#include <IRremote.h>
int RECV_PIN = 7;
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
}
delay(100);
}
So then I tried running the Dump code found here. IRreceiveDump
And that doesn't seem to help either.
The first time I ran it I got this in my Serial Monitor:
"Some Timer conflicts, with other libraries, can be easily resolved by configuring a different Timer for your platform"
Then I ran it again and I get this:
C:\Users\name\DocuYoteInt.h
IRremote.h
You can save SRAM by disabling the Decode or Send features for any protocol (Near the library
IRremoteInt.h
IRremote.h
You can save SRAM by disabling the Decode or Send features for any protocol (Near th⸮⸮⸮We⸮u!⸮
Any ideas what could be causing this? This is my first attempt at using a IR Remote and I dont know if I am doing something wrong? Or if I got a bum reciever?
The first time I ran it I got this in my Serial Monitor:
"Some Timer conflicts, with other libraries, can be easily resolved by configuring a different Timer for your platform"
That's just the last line of the serial output of the sketch. It's written in every case even if there's absolutely no problem with timers.
Any ideas what could be causing this?
Communication problems or an unstable Arduino (may be a hardware problem or a driver problem on the PC. Do you use an original Arduino UNO?
Thanks for the reply. To add some extra clarity...
This is the exact Arduino Uno I ordered from Amazon.
I already posted the Code I used to test.
Here is a link to the library I am using.
As far as a wiring diagram goes...I don't have an image atm. So I will just explain it.
I have the Gnd on the IR and the Gnd on the arduino hooked up to a 5V power supply so that they are grounded together.
The Arduino is pulling power from the USB via computer atm. And the Red on the IR is also hooked up to the 5V power supply.
The S output on the IR is going to the 7 pin on the Arduino.
Nothing else is hooked into the system atm.
I have ordered 2 different IR receivers from Amazon that should be delivered tomorrow. Hoping this is just a case of my IR having an issue or being a lemon. We will see I guess. I have a friend who has one he got in a kit that is hooked up in basically the same way. He ran the same code I posted here on his and it returns a bunch of HEX values like it should with no issues.
That IR receiver module has a led on it which should flash during a burst of pulses from the remote control. If it doesn’t, have you a TV or other remote control device which you could try?
The remote control which you have purchased, incidentally, uses the NEC IR protocol.
I have not tried a different battery, but the one in there is triggering the LED no problem. I have not tried using different wires but since it is getting a signal and returning something I assume that isnt the issue. I will test different wires anyway just to be sure.
Yes the LED blinks when I press a button on the remote.
@larryd, could you elaborate on "Investigate your IDE installation"? I know what that is, but I have no idea how to troubleshoot it or what I should investigate to figure this out. Short of trying a completely new IR Receiver I am not sure what else to do at this point. I am very new to all of this so keep that in mind.
I’ve seen reports of a number of similar issues recently (zeros returned by the IR code). There has also been a lot of activity in the IR library recently. A error may have been introduced.
I just downloaded what I thought was the version 3.0.0 of the library and reinstalled it. But when I look at it in my Library Manager all I see is version 2.8.1. That wasn't working. But then I switched it to version 2.8.0 and BAM!!! Its working!
So now the people managing this code need to know that version 2.8.1 is bad and nuke it from the universe!!
Adding a graphic here to help anyone else who may come across this because this is not very obvious to people who are new to Arduino. And its about the most frustrating thing imaginable.
warning: 'bool IRrecv::decode(decode_results*)' is deprecated: You should use decode() without a parameter. [-Wdeprecated-declarations]
if (irrecv.decode(&results))