You need to use #define to assign a value to the IRswtich things. They are only placeholders, the compiler will go through and replace all "IRswitch1" with whatever you put after it. So it would like:
Code:
#define IRswitch1 rc_dig_in01
#define IRswitch2 rc_dig_in02
#define IRswitch3 rc_dig_in03
#define IRswitch4 rc_dig_in04
Assuming you used those four for your IR wiring. And then to use them:
Code:
if (!IRswitch1) //If the IR has been pressed
auto_routine_1(); //Do whatever when switch is down
}
Just as an example, here's how we defined it:
Code:
// IR Inputs
#define IR_DIG_1 rc_dig_in07
#define IR_DIG_2 rc_dig_in08
#define IR_DIG_3 rc_dig_in09
#define IR_DIG_4 rc_dig_in10
// IR Values
#define IR_DISCONNECTED (IR_DIG_1 && IR_DIG_2 && IR_DIG_3 && IR_DIG_4)
#define IR_1 (IR_DIG_1 && !IR_DISCONNECTED)
#define IR_2 (IR_DIG_2 && !IR_DISCONNECTED)
#define IR_3 (IR_DIG_3 && !IR_DISCONNECTED)
#define IR_4 (IR_DIG_4 && !IR_DISCONNECTED)
That way you won't get confused when the IR board is out.