IR Sensor

I Am Trying To Make My Ir Sensor Activate Pin 13 To Drive My Motor. However It Wont Do That No Matter What I Try.

I Get 2758 From Remote Decoder From This.

#include <IRremote.h>

const int RECV_PIN = 22;

IRrecv irrecv(RECV_PIN);

decode_results results;

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

void loop() {
  if (irrecv.decode(&results)) {
    if (results.decode_type == NEC) {
      Serial.print("NEC: ");
    } else if (results.decode_type == SONY) {
      Serial.print("SONY: ");
    } else if (results.decode_type == RC5) {
      Serial.print("RC5: ");
    } else if (results.decode_type == RC6) {
      Serial.print("RC6: ");
    } else if (results.decode_type == UNKNOWN) {
      Serial.print("UNKNOWN: ");
    }
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}

But It Wont Run My Motor

#include <IRremote.h>

int receiver = 22;
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results decodedSignal;

///


// Motor code
//Arduino PWM Speed Control?
int E1 = 3;   
int M1 = 12;
int E2 = 11;                         
int M2 = 13;                           

///



void setup() 
{ 
    Serial.begin(9600);
    pinMode(M1, OUTPUT);   
    pinMode(M2, OUTPUT); 
    pinMode(E1, OUTPUT);
    pinMode(E2, OUTPUT);   
    irrecv.enableIRIn(); // Start the receiver
}
void loop() 
{ 

  
int value=255; //SPEED CONTOL
  
   if (irrecv.decode(&decodedSignal)) // have we received an IR signal?
  {
    if (decodedSignal.value == 2758) {  // Forwards   
      Serial.println("Forwords");
      digitalWrite(M1,HIGH);   
      digitalWrite(M2,HIGH);       
      analogWrite(E1, value);   //PWM Speed Control
      analogWrite(E2, value);   //PWM Speed Control
      }
}

It Doesent even light up pin 13’s Light?

IR library prevents PWM on some pins. I know from personal experience, pin 3 is one that stops PWM-ing, not sure what others. But you do use pin 3...

The value 2758 that you got is in HEX

    Serial.println(results.value, HEX);

try

    if (decodedSignal.value == 0x2758)

I Have To Use Pin 3 Due TO Arduino Motor Shield Using It, But It Still Doesn't Work I Tried 0x2758.

Well you can't pwm pin 3 if you use the IR library....

Is There Any Other Library's?

adruinouno111: Is There Any Other Library's?

I don't know... maybe other members know of a way to modify the library so it doesn't mess with pin 3.