Connect with us

IR: Custom Messages

Discussion in 'Microcontrollers, Programming and IoT' started by _Nate_, Apr 2, 2018.

Scroll to continue with content
  1. _Nate_

    _Nate_

    99
    0
    Jun 12, 2017
    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.
     
  2. Bluejets

    Bluejets

    4,271
    908
    Oct 5, 2014
    Hi Nate,
    It is always helpful to supply things like a link to your project so others can see what you are dealing with.

    I have an inkling you may be jumping in midstream instead of doing it from the start, hence the confusion on your part.

    However, I took a quick peek on Github and found some info that might be of some assistance to you in the meantime.
    https://github.com/z3t0/Arduino-IRremote/wiki

    Cheers Jorgo
     
  3. _Nate_

    _Nate_

    99
    0
    Jun 12, 2017
    Thanks! I did give some info on the project and all the code. I'm trying to get info on one specific part of it: being able to send custom commands over an ir signal.

    Edit: I did look over the link you sent and I have read the information. Still, there is nothing about what code you are supposed to transmit for a home-made receiver.
     
  4. _Nate_

    _Nate_

    99
    0
    Jun 12, 2017
    Still haven't found the answer... anyone?
     
  5. _Nate_

    _Nate_

    99
    0
    Jun 12, 2017
  6. _Nate_

    _Nate_

    99
    0
    Jun 12, 2017
    Sadly, this is only for communication of the serial port. I'm trying to use the IR transmitter and receiver for the most practical use, yet there is nothing I can find on it. I don't want to use a random IR tv remote to control things, I want to use my arduino as the remote to control another arduino.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-