Yes, I am fully aware of the many, many tutorials on this subject. However, I am a noob at this so bear with my simple minded questions. That being said, here's the problem.
I am at trying to emulate a Sony Clock Radio remote. I couldn't find any documentation on the remote I am using (I was hopeful) so I made my own little decoder to decode and display what was being transmitted(what I wanted to emulate) and I got the following:
Value: 1766718754
Bits: 32
Result type: -1
Raw Length: 68
my code for this :
#include <IRremote.h>
int IRpin = 11;
IRrecv irrecv(IRpin);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.print("Value: ");
Serial.println(results.value);
Serial.print("Bits: ");
Serial.println(results.bits);
Serial.print("Result type: ");
Serial.println(results.decode_type);
Serial.print("Raw Length: ");
Serial.println(results.rawlen);
Serial.println("");
irrecv.resume();
}
}
Now, with that out of the way and knowing the value sent as well as the number of bits, I made this to try to send the signal:
#include <IRremote.h>
#include <IRremoteInt.h>
IRsend irsend;
void setup(){
Serial.begin(9600);
}
void loop(){
if (Serial.read() == 'send'){
irsend.sendSony(1766718754, 32);
delay(500);
}
}
I get this error when compiling :
IRremote\IRremote.cpp.o: In function MATCH(int, int)': /IRremoteInt.h:176: multiple definition of MATCH(int, int)'
sketch_sep06a.cpp.o:C:\Users\Jake2_000\Documents\Arduino\libraries\IRremote/IRremoteInt.h:176: first defined here
IRremote\IRremote.cpp.o: In function MATCH_MARK(int, int)': /IRremoteInt.h:177: multiple definition of MATCH_MARK(int, int)'
sketch_sep06a.cpp.o:C:\Users\Jake2_000\Documents\Arduino\libraries\IRremote/IRremoteInt.h:177: first defined here
IRremote\IRremote.cpp.o: In function MATCH_SPACE(int, int)': /IRremoteInt.h:178: multiple definition of MATCH_SPACE(int, int)'
sketch_sep06a.cpp.o:C:\Users\Jake2_000\Documents\Arduino\libraries\IRremote/IRremoteInt.h:178: first defined here
What? I have no inkling as to what this means. I used the irsend.sendSony(0xa90, 12); from the IRsendDemo. Just swapped in my results from my decoder. Now how do I fix this puzzling problem? ![]()
Sorry, forgot to add that I tried the hex code "FE58A7" instead of "1766718754" and still got an error :
sketch_sep06a.ino: In function 'void loop()':
sketch_sep06a:11: error: 'FE58A7' was not declared in this scope
Which has me equally puzzled(I am very new)
If you could also keep the answer simple for me to understand that would be well appreciated, I like to learn, not just copy-paste.
Many thanks XD