IR Wand Control Robot

Hi, I am working on a project to where I want to turn on an LED by a IR wand (similar to the ones found at Disney) with the IR receiver. Later on, I want to control the robot that I have with my wand by moving the robot forward, left, right, and backward. I have an Arduino Uno with the IR Receiver . I have tested to get the IR "code" from the receiver, but when I want to get an if-statement, it gives me this error:

C:\Users\uptow\OneDrive\Desktop\IRReceiverLED\IRReceiverLED.ino: In function 'void loop()':
IRReceiverLED:35:29: error: unable to find numeric literal operator 'operator""CF4AC3'
         if(results.value == 41CF4AC3){
                             ^~~~~~~~
Multiple libraries were found for "IRremote.h"
 Used: C:\Users\uptow\OneDrive\Documents\Arduino\libraries\IRremote-2.2.3
 Not used: C:\Users\uptow\OneDrive\Documents\Arduino\libraries\Arduino-IRremote-master
exit status 1
unable to find numeric literal operator 'operator""CF4AC3'

It's as if the code doesn't like that hex code, for some reason. Anyways, here is the code:

/*
  IR Receiver Demonstration 3
  IR-Rcv-Demo3.ino
  Control LED's using Unused IR Remote keys

  DroneBot Workshop 2017
  http://dronebotworkshop.com
*/

// Include IR Remote Library by Ken Shirriff
#include <IRremote.h>

// Define sensor pin
const int RECV_PIN = 12;

// Define LED pin constants
const int redPin = 2; 

// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;


void setup(){
  // Enable the IR Receiver
  irrecv.enableIRIn();
  // Set LED pins as Outputs
  pinMode(redPin, OUTPUT);
}


void loop(){
    if (irrecv.decode(&results)){

        if(results.value == 41CF4AC3){
        // Turn on LED for 2 Seconds
        digitalWrite(redPin, HIGH);
        delay(2000);
        digitalWrite(redPin, LOW);
    }
    irrecv.resume(); 
  }
}

try

0x41CF4AC3

@paulpaulson Thank you, that worked! Here is the new code:

/*
  IR Receiver Demonstration 3
  IR-Rcv-Demo3.ino
  Control LED's using Unused IR Remote keys

  DroneBot Workshop 2017
  http://dronebotworkshop.com
*/

// Include IR Remote Library by Ken Shirriff
#include <IRremote.h>

// Define sensor pin
const int RECV_PIN = 12;

// Define LED pin constants
const int redPin = 2; 

// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;


void setup(){
  // Enable the IR Receiver
  irrecv.enableIRIn();
  // Set LED pins as Outputs
  pinMode(redPin, OUTPUT);
}


void loop(){
    if (irrecv.decode(&results)){

        if(results.value == 0x41CF4AC3){
        // Turn on LED for 2 Seconds
        digitalWrite(redPin, HIGH);
        delay(2000);
        digitalWrite(redPin, LOW);
    }
    irrecv.resume(); 
  }
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.