Hi,
I have two arduino nano:
IR reciver:
#include <IRremote.hpp>
/* rawR&cv.ino Example sketch for IRLib2
* Illustrate how to capture raw timing values for an unknow protocol.
* You will capture a signal using this sketch. It will output data the
* serial monitor that you can cut and paste into the "rawSend.ino"
* sketch.
*/
// Recommend only use IRLibRecvPCI or IRLibRecvLoop for best results
#include <IRLibRecvPCI.h>
IRrecvPCI myReceiver(2);//pin number for the receiver
void setup() {
Serial.begin(9600);
delay(2000); while (!Serial); //delay for Leonardo
myReceiver.enableIRIn(); // Start the receiver
Serial.println(F("Ready to receive IR signals"));
}
void loop() {
//Continue looping until you get a complete signal received
if (myReceiver.getResults()) {
Serial.println(F("Do a cut-and-paste of the following lines into the "));
Serial.println(F("designated location in rawSend.ino"));
Serial.print(F("\n#define RAW_DATA_LEN "));
Serial.println(recvGlobal.recvLength,DEC);
Serial.print(F("uint16_t rawData[RAW_DATA_LEN]={\n\t"));
for(bufIndex_t i=1;i<recvGlobal.recvLength;i++) {
Serial.print(recvGlobal.recvBuffer[i],DEC);
Serial.print(F(", "));
if( (i % 8)==0) Serial.print(F("\n\t"));
}
Serial.println(F("1000};"));//Add arbitrary trailing space
myReceiver.enableIRIn(); //Restart receiver
}
}
and the sender:
#include <IRLibSendBase.h>
#include <IRLib_HashRaw.h>
#include <IRLibCombo.h>
IRsendRaw mySender;
#define IR_SEND_PWM_PIN D3
#define RAW_DATA_LEN 74
void setup() {
Serial.begin(9600);
delay(2000); while (!Serial); //delay for Leonardo
Serial.println(F("Every time you press a key is a serial monitor we will send."));
}
void loop() {
uint16_t rawData[RAW_DATA_LEN]={
9006, 4502, 642, 1666, 642, 566, 634, 570,
638, 570, 638, 566, 634, 574, 634, 570,
642, 566, 646, 1662, 642, 562, 638, 1670,
638, 570, 638, 566, 642, 566, 634, 574,
634, 570, 642, 566, 642, 566, 634, 570,
638, 570, 638, 1666, 642, 1666, 642, 566,
646, 562, 634, 570, 638, 570, 642, 562,
634, 574, 638, 1670, 638, 566, 642, 1666,
642, 566, 634, 570, 638, 1670, 638, 570,
638, 1000};
mySender.send(rawData,RAW_DATA_LEN,38);
delay(5000);
}
I use:
with direct connection.
My reciver display different values that I sent:
#define RAW_DATA_LEN 74
uint16_t rawData[RAW_DATA_LEN]={
9042, 4550, 642, 1694, 634, 574, 638, 594,
614, 622, 610, 594, 618, 590, 642, 594,
634, 570, 642, 1694, 638, 594, 614, 1698,
634, 598, 610, 598, 634, 598, 614, 594,
638, 594, 638, 570, 638, 594, 614, 594,
638, 594, 638, 1698, 610, 1702, 642, 590,
642, 590, 618, 590, 642, 566, 646, 586,
610, 598, 634, 1702, 642, 590, 642, 1666,
642, 594, 614, 590, 642, 1694, 638, 598,
610, 1000};
Do a cut-and-paste of the following lines into the
designated location in rawSend.ino
Where is the problem?

