and when I want to have the deck do something, I send the IR Command: irsend.sendNEC(PLAY_FWD_1, 32); and this works.
However, I am using the serial port on the Ardunio to get the commands, the command is a char array, and this does not work:
gives the errors:
W_890_IR_Control_test:151: error: invalid conversion from 'char*' to 'long unsigned int'
W_890_IR_Control_test:151: error: initializing argument 1 of 'void IRsend::sendNEC(long unsigned int, int)'
So, how do I change the char so it is recognised as the defined constant, or am I doing it wrong?
Thanks
Karl.
#define macros are only in existence up to the point when you compile the sketch. One of the first things the compiler does is go through and replace any instances of a #define macro with the contents of the macro. You will never have access to those macros from within your sketch.
You will have to compare the contents of your char array with some predefined (constant) char arrays (literals) and call the send function accordingly:
Of course not - "PLAY_FWD_1" is not a number, in the same sense that "Tunafish" isn't a number. Macros don't work in quotes. Also, as I mentioned previously, they don't exist after compilation, so you can't use the name of them for anything.