Hello this is my first project using the Arduino. It will control window blinds using an IR TV remote. I have everything working but i get servo jitter when the blinds are in the open position. (This makes noise) Is there anyway i stop the servo jitter? I am using +5v power from the Arduino to power the micro servo.
Here is my code any help would be appreciated ![]()
#include <Servo.h>
#include <IRremote.h>
unsigned long Value2 = 0x4CB3E11E; // This the IR code from the remote that will close the blinds.
unsigned long Value1 = 0x4CB311EE; // This the IR code from the remote that will open the blinds.
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
Servo servo1;
// the setup routine runs once when you press reset:
void setup() { Â Â Â Â Â Â Â
Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 // initialize the digital pin as an output.
servo1.attach(10); // attack servo to digital pin 10
}
// the loop routine runs over and over again forever:
void loop() {
if (irrecv.decode(&results)) {
  Serial.println(results.value, HEX);
  irrecv.resume(); // Receive the next value
 }
if(results.value == Value1) {
servo1.write(120);
}
if(results.value == Value2) {
servo1.write(20);
}
}
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.