IR remote to control 1 servo

hi

I have been trying to control a servo to go to 100little circle when i press the + button on my remote but it won’t work :frowning:
here is my code
/code/
/*
Some Sample code of how to use your IR remote

  • Lets get started:

The IR sensor’s pins are attached to Arduino as so:
Pin 1 to Vout (pin 11 on Arduino)
Pin 2 to GND
Pin 3 to Vcc (+5v from Arduino)

*/

#include <IRremote.h>
#include <Servo.h>

int IRpin = 11; // pin for the IR sensor
int pos = 100;
IRrecv irrecv(IRpin);
decode_results results;
Servo myservo;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver

myservo.attach(9);
}

void loop()
{

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

if (results.value == 16754775) // change zero to your IR remote button number
{
myservo.write(pos);
delay(15);

}
/code/
is it my coding skills or something else.
servo = pin 9
IR = pin 11

Have you confirmed that the IR signal received is the value you have coded?

Weedpharma

try this

void loop() 
{
   
  if (irrecv.decode(&results)) 
    {
      Serial.println(results.value, DEC);
  
   if (results.value == 16754775)  // change zero to your IR remote button number
     {
       myservo.write(pos);
       delay(15);
          
     }
     irrecv.resume();   // Receive the next value
    }

}

note you dont seem to be changing the value of pos !!

thanks
im a noob

the servo dose not want to turn I'm getting these values
16754775
4294967295

what did you mean by changing the value of pos?

oh now i get it
i know all i want is to get it to go to 100little circle