IR Receiver Error - Depreciated

I get this warning:

The function decode(&results)) is deprecated and may not work as expected! Just use decode() without a parameter and IrReceiver.decodedIRData.<fieldname> .

Its from this code snippet:

//
// IR Remote control object
//
IRrecv irrecv(RECV_PIN);      // Build IR receiver object
//
// This next line throws a compiler warning anbout being depreciated
// but I've not found what to replace it with that compiles, runs
// and actually works.
//
decode_results results;       // Not sure about this, but it works

I looked it up, and when I tried the suggested replacement code it wouldn't compile.
The Wiki and related pages are anything but clear. And they explain WHAT but are lite on the WHY.

But only you can see the complete, updated code and the complete error message.

Did you study the examples that come with the library?

This IS the example from the library. It's thrown that error since it was installed. It works well, but it seems like you have to completely restructure to change lib's. Lots of work unless there's a simple fix. What can I say, I'm a lazy SOB.

The SimpleReceiver example for the current version of the library does not supply an argument to the decode() function.

You can downgrade the library; install version 2.x instead of 3.x. Or adjust the code to the newer version.

It's not an error, it's a warning. With an error, your code would not compile :wink:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.