Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Use of IRremote library in "Make an Arduino-Controlled Robot"

Please relay this to Margolis.

When I loaded the IRremote library that he provides, restarted arduino app on Mac, I got 0 when printing out ir results with leonardo. Same problem with arduino. I was using the test irreceive sketch in the library.

However, when I used the library from the GitHub for IRremote and changed irRemoteInt.h to use timer 1 for the atmega32u4, things worked fine.

Am concerned that Margolis library does not work as advertised.

I am using Mac with latest OS X version.

Tom Lasinski
talasinski@gmail.com

Sent from my iPad
1 person has
this problem
+1
Reply
  • Brian Jepson (Editor, Maker Media, Inc.) May 23, 2013 18:12
    Hi Tom,

    Sorry about the problems you're having with the library. I'll ask Michael to take a look and to get back to us with an answer.

    Thanks,

    Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Brian Jepson (Editor, Maker Media, Inc.) May 30, 2013 13:13
    Hi Tom,

    Sorry about the delay, but the MAKE team and the author were all on travel for Maker Faire, and he had a bit farther to travel to get home. Michael was wondering which version of the IDE you're using, because a new version came out recently. Is it 1.05?

    Thanks,

    Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Brian Jepson (Editor, Maker Media, Inc.) May 30, 2013 14:12
    Hi Tom,

    I wanted to let you know that I tried out the library that Michael provided with Arduino 1.05 on Mac OS X, and made a few modifications to the IRrecvDemo sketch:


    1. Used digital pins for 5V and ground so I could slide the IR receiver directly into the Leonardo.
    2. Set those pins to output, then took one pin high (to provide 5V) and the other low (GND)
    3. Added a while() loop to wait for the serial port to come available.


    I was able to get non-zero results in the console window when I pressed buttons on my remote:

    FF9867
    FF18E7
    FF38C7


    Here is the complete modified example that worked for me:
    #include <IRremote.h>

    int RECV_PIN = 11;
    int VCC_PIN = 13;
    int GND_PIN = 12;

    IRrecv irrecv(RECV_PIN);

    decode_results results;

    void setup()
    {
    Serial.begin(9600);
    while(!Serial); // only needed for leonardo

    Serial1.println("Hello");
    pinMode(VCC_PIN, OUTPUT);
    pinMode(GND_PIN, OUTPUT);
    digitalWrite(VCC_PIN, HIGH);
    digitalWrite(GND_PIN, LOW);
    irrecv.enableIRIn(); // Start the receiver
    }

    void loop() {
    if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
    }
    }


  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited indifferent, undecided, unconcerned