IR HELP.. 'E054377D' was not declared in this scope

Hello I get this error message.. when I put 0x in front, it can compile...
This is the code:

#include <IRremote.h>
int jacina = 0;
int led = 10;
int RECV_PIN = 8;
boolean dugme = HIGH;

IRrecv irrecv(RECV_PIN);

decode_results results;

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

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    switch (results.value) {
      case E054377D:
      dugme == !dugme;
      switch (dugme) {
      case HIGH:
      case FFA857:
      jacina++;
      break;
      case FFE01F:
      jacina--;
      break;
      break;
      case LOW:
      jacina == 0;
      break;
      }
    }
    irrecv.resume(); 
  }
  analogWrite(led,jacina);
  delay(100);
}

results.value returns an unsigned long value. 0xE054377D is an unsigned long value in hex format. E054377D is not.

So, how can I solve my problem? When I load dump info I get values without 0x, and as I saw in other codes, they don't use hex code..
Thx for help :slight_smile:

lukapetko2:
So, how can I solve my problem?

What is the problem?- you said it's fixed if you put 0x in the switch...case, and you have control over what you write in the sketch, so why not just do that?

Well, because when i press button on my remote, i get it without 0x.. :frowning:

 case LOW:
      jacina == 0;
      break;

What's that?

lukapetko2:
Well, because when i press button on my remote, i get it without 0x.. :frowning:

I don't understand that statement.

What you get, when you press a button on the remote, is a numeric value. How you print that value has no bearing on how you present the same value to the compiler. That you don't print the 0x doesn't mean anything to us.

Hello, I'm going to explain it again.. I have ir remote controler without documentation and I loaded program that prints me certain characters when i press specific button on remote. Then i put given value in case statement. If I put 0x in front , case function wont work because it receives it without 0x..
On some remotes it works, on some it does not..
How can I solve this?

The hex is just a representation of the pulses of the code.
For the code to compile, you must use the 0x prefix.

Ok. How can I implement that in my code? I tried it and nothing happens...

and I loaded program that prints me certain characters when i press specific button on remote.

So where IS that code?

If I put 0x in front , case function wont work because it receives it without 0x..

It received a number. You do NOT know that the number was in HEX format. For all you know, it was in base 27 format. Then, you printed that number in base 16 format, and the printing function did not add the 0x prefix BECAUSE THAT IS A COMPILER DIRECTIVE.

Get over it!

Ok. How can I implement that in my code? I tried it and nothing happens...

And, once again, you FAILED to post the damned code.

#include <IRremote.h>
int jacina = 0;
int led = 10;
int RECV_PIN = 8;
boolean dugme = HIGH;

IRrecv irrecv(RECV_PIN);

decode_results results;

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

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    switch (results.value) {
      case E054377D:
      dugme == !dugme;
      switch (dugme) {
      case HIGH:
      case FFA857:
      jacina++;
      break;
      case FFE01F:
      jacina--;
      break;
      break;
      case LOW:
      jacina == 0;
      break;
      }
    }
    irrecv.resume(); 
  }
  analogWrite(led,jacina);
  delay(100);
}

I thought we'd established that that code doesn't compile?

    Serial.println(results.value, HEX);

Why don't you make life easy for yourself, and print the number in a way that you AND the compiler like?

    Serial.println(results.value);

It's past time that you learned the difference between the assignment operator (=) and the equality operator (==) and that they are NOT interchangeable.