I am using the IRremote.h library which when used with the command
IrReceiver.printIRResultShort(&Serial);
prints a response in the form:
Protocol=NEC Address=0x0 Command=0x3 Raw-Data=0xFC03FF00 32 bits LSB first
I would like to reformat that response to put, for instance, line breaks where the white spaces are or to remove some of the information such as Raw-Data and LSB first. Is there a way to do that?
This function is a kind of debug information. The result cannot be redirected. When you need each piece of data, you need to read it using the usual library calls.
Thanks. I noticed how the library does that and it would be easy to modify the library in my IDE, but then if the library were updated my project would break. I naively thought I could somehow use those variables supplied by the library in my project without modifying the library it self. Perhaps I should look for another library.
I finally figured how to retrieve the variables from the library and use them in my sketch without modifying the library like this:
int address = IrReceiver.decodedIRData.address;
int command = IrReceiver.decodedIRData.command;
String make = getProtocolString(IrReceiver.decodedIRData.protocol);
Yes, indeed. My thanks to johnwasser. I hadn't seen his reply and found out how to do this by trial and error. Maybe I should have waited for John's reply, but having found out how to do it for myself, I am sure I will never forget it.
Plus, with my method I have the variables to use for other functions in the sketch, for example to use with IrSender to test the code after retrieving it.