So I'm trying to get my Arduino UNO to send IR messages to my Nanos, but all is not going according to plan. I have an IR receiver attached to my nano and the transmitter on my uno, but I'm stuck. I want to send signals from the uno to the nano and use it as some sort of remote. Here is my code:
Transmitter:
#include <IRremote.h>
IRsend irsend;
void setup() {
Serial.begin(9600);
}
void loop() {
irsend.sendNEC(0xAA00AA, 32); // What args do I use here?
Serial.println("Sending Message...");
digitalWrite(13,HIGH);
delay(250);
digitalWrite(13,LOW);
delay(750);
}
Receiver:
#include <IRremote.h>
IRrecv irrecv(8);
decode_results results;
void setup() {
Serial.begin(9600);
pinMode(8,INPUT);
irrecv.enableIRIn();
}
void loop() {
Serial.println("Attempting Read...");
if(irrecv.decode(&results))
switch(results.value){
Serial.println(results.value);
}
delay(500);
}
My main question is, in the transmitter code, what code exactly do I transmit? Right now, while this code is running, the nano does not print the results of the code sent.
Transmitter:
#include <IRremote.h>
IRsend irsend;
void setup() {
Serial.begin(9600);
}
void loop() {
irsend.sendNEC(0xAA00AA, 32); // What args do I use here?
Serial.println("Sending Message...");
digitalWrite(13,HIGH);
delay(250);
digitalWrite(13,LOW);
delay(750);
}
Receiver:
#include <IRremote.h>
IRrecv irrecv(8);
decode_results results;
void setup() {
Serial.begin(9600);
pinMode(8,INPUT);
irrecv.enableIRIn();
}
void loop() {
Serial.println("Attempting Read...");
if(irrecv.decode(&results))
switch(results.value){
Serial.println(results.value);
}
delay(500);
}
My main question is, in the transmitter code, what code exactly do I transmit? Right now, while this code is running, the nano does not print the results of the code sent.