Servo motor woth IR sensor not working

I was recently trying to make a circuit so that when I press a button on an infrared remote, it would make a servo turn, however the code isn't working. Heres the code:

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

#define Button_1 0xE718FF00
#define Button_2 0xAD52FF00
IRrecv IR(13); // Im using the pin 13
decode_results results;
int servoPin = 3; 
// Create a servo object 
Servo Servo1; 

void setup(){
  Serial.begin(9600);
  IR.enableIRIn();
  Servo1.attach(servoPin); // We need to attach the servo to the used pin number 
}

void loop(){
  if (IR.decode()){
        Serial.println(IR.decodedIRData.decodedRawData, HEX);
        IR.resume();
         switch(results.value) {
           case Button_1 : Servo1.write(45);  break;
           case Button_2 : Servo1.write(0); break;
           
      } 
  }
}

This code decodes Hex just fine; however, when the correct hex codes are inputted, the servo doesn't move. Help!

Complete circuit diagram would be helpful ( NOT Fritzing thankyou).

here you go:

Statement conveys no useful information.

Good job on properly posting code. :+1:

It is a well known conflict between the Servo libraray and the IRremote library. Many people try the ServoTimer2 library. >>>>>

thanks! trying now.

so, I tried to upload this to my uno r3, and it did not work. can you help me with the code?

Please post the latest version of your test code. I cannot help with code that I cannot see.

with servotimer2? or with servo the normal library

here you go:

#include <ServoTimer2.h>
#include <IRremote.h>

#define Button_1 0xE718FF00
#define Button_2 0xAD52FF00
IRrecv IR(13); // Im using the pin 13
decode_results results;
int servoPin = 3; 
// Create a servo object 
ServoTimer2 Servo1;
void setup(){
  Serial.begin(9600);
  IR.enableIRIn();
  Servo1.attach(3); // We need to attach the servo to the used pin number 
}

void loop(){
  if (IR.decode()){
        Serial.println(IR.decodedIRData.decodedRawData, HEX);
        IR.resume();
         switch(results.value) {
           case Button_1 : Servo1.write(750);  break;
           case Button_2 : Servo1.write(1500); break;
           
      } 
  }
}

750 might be beyond the range of the servo.
Normal servo travel is 1000, 1500 and 2000.

Where is the 5v supply coming from?

What is the IR remote spec.?

the 5v is coming from the arduino

If via the Arduino regulator, not a good idea for driving any servo.
Which I asked for a "complete" circuit diagram.
i.e. do you have a higher voltage to the Vin ????

It is important that we see a complete schematic as @bluejets requestes.

Do you have the latest versions of each libraray installed? If we are working from different versions it can cause confusion.

I cant work on this till tomorrow. Maybe more timely help will come along.

Where is it known???

Sorry for being rude, but please do not tell nonsense to a beginner!
see line 38 in Servo.h
default min is 544, max is 2400

It is generally a bad idea to use the LED output pin for any input purpose.

If you put this in setup(), does it work?