Go Down

Topic: sketch_jan17a:31:14: error: 'RCA' was not declared in this scope (Read 296 times) previous topic - next topic

jpopjr

Something very strange is happening. The following code works but only if I use switch variables listed on the YouTube example: https://www.youtube.com/watch?v=8E3ltjnbV0c at around 11:00 minutes into the podcast.
But when I change a case variable not on the list the podcast list, I get the error:

    error: 'RCA' was not declared in this scope

What is going on please. Thank you in advance.

I pasted the code for convenience:

#include <IRremote.h>
#include <IRremoteInt.h>\
//#include <stdio.h>



//Define sensor pin
const int RECV_PIN = 4;


//Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;


void setup() {
// Serial Monitor @ 9600 baud rate
Serial.begin(9600);

//Enable the IR Receiver
irrecv.enableIRIn();

}

void loop() {

if(irrecv.decode(&results)){
  //Print code in HEX
    Serial.println(results.value, HEX);
    switch (results.decode_type){
        case NEC:
          Serial.println("NEC");
          break;
        case MITSUBISHI:
           Serial.println("MITSUBISHI");
           break;
        case DISH:
           Serial.println("DISH");
           break;
        case SONY:
           Serial.println("SONY");
           break;
     default:
           Serial.println("UNKNOWN");
           break;
    }
    irrecv.resume();
}

}

UKHeliBob

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

gfvalvo

From IRremote.h I don't see an RCA.

Code: [Select]
//------------------------------------------------------------------------------
// An enumerated list of all supported formats
// You do NOT need to remove entries from this list when disabling protocols!
//
typedef
enum {
UNKNOWN      = -1,
UNUSED       =  0,
RC5,
RC6,
NEC,
SONY,
PANASONIC,
JVC,
SAMSUNG,
WHYNTER,
AIWA_RC_T501,
LG,
SANYO,
MITSUBISHI,
DISH,
SHARP,
DENON,
PRONTO,
LEGO_PF,
}
decode_type_t;
No technical questions via PM. They will be ignored. Post your questions in the forum so that all may learn.

Go Up