Arduino IRremote + Servo Problem

I’m having some sort of issue with this. The servo is twitchy. Using https://github.com/shirriff/Arduino-IRremote and http://arduino.cc/en/Reference/Servo

It twitches just by having both enabled. I’ve included the code I used for the first part of the video. If you know why this is happening, I’d love to hear it.

[c]
#include <IRremote.h>
#include <Servo.h>

int RECV_PIN = 7;

IRrecv irrecv(RECV_PIN);

decode_results results;

Servo myservo;
int pos = 90;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
myservo.attach(9);
myservo.write(pos);
}

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

[/c]

3 thoughts on “Arduino IRremote + Servo Problem

  1. Hello, I am curious if you found a fix to your servo + IR issue. I am having the same problem whenever I attach a servo within the IRrecvDemo sketch. Thank you.

    Like

  2. i am testing both ir and servo libraries, i saw the problem is:
    interrupts, infrareds and servos using interrupts, and this is happining.

    Like

  3. Dear Sky

    I am also having same problem of twicthing of servo when trying to control with Remote control?
    Can you please share any solution or code related to this.My project is stuck because of this issue.

    My Email id is shail363@yahoo.com
    Thanks is advance
    Regards
    Shailesh

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: