IR code "'E8289565' was not declared in this scope"

I am making an arduino Cricket Scorer. I will not explain my project but i use an IR remote to update things on my LCD screen which is connected to the arduino. is I seem to have many errors but the main one I cannot seem to explain is this one: ‘E8289565’ was not declared in this scope. I have a switch statement with cases. Here is one of them:

case E8289565:
((score = score +=1) && (balls = balls +=1));
break;"

Here are the error messages in full:

Arduino: 1.6.7 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

/Users/darceyhs/Documents/Arduino/CricketScorer/CricketScorer.ino: In function ‘void translateIR()’:
CricketScorer:74: error: ‘E8289565’ was not declared in this scope
case E8289565:
^
CricketScorer:78: error: unable to find numeric literal operator ‘operator"" DCD’
case 66800DCD:
^
CricketScorer:82: error: ‘C03CA26F’ was not declared in this scope
case C03CA26F:
^
CricketScorer:85: error: unable to find numeric literal operator ‘operator"" DF’
case 490541DF:
^
CricketScorer:88: error: ‘B1CE824B’ was not declared in this scope
case B1CE824B:
^
CricketScorer:91: error: unable to find numeric literal operator ‘operator"" F6EBBF3’
case 6F6EBBF3:
^
CricketScorer:91: error: case label ‘’ not within a switch statement
case 6F6EBBF3:
^
CricketScorer:92: error: expected ‘}’ at end of input
((score = score +=6) && (balls = balls +=1));
^
exit status 1
‘E8289565’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

I know my coding is average and is also very messy. I am certainly no expert on c++ or coding in general.
Here is the full code:

#include “IRremote.h”

int RECV_PIN = 8;

int score = 0;

int addedScore = 0;

int addedBalls = 0;

int overs = 0;

int runRate = 0;

int balls = 0;

#define add2 66800DCD
#define add3 C03CA26F
#define add4 490541DF
#define add5 B1CE824B
#define add6 6F6EBBF3

IRrecv irrecv(RECV_PIN);

decode_results results;

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
}

void loop() {
balls = balls + addedBalls;
score = score + addedScore;
overs = balls / 6;
runRate = overs * score;

lcd.setCursor(0,0);
lcd.print(“Score:”);
lcd.print(score);
lcd.setCursor(9,0);
lcd.print(“Overs:”);
lcd.print(overs);
lcd.setCursor(0, 1);
lcd.print(“Mins:”);
// print the number of seconds since reset:
lcd.print(millis() / 60000);
lcd.setCursor(9,1);
lcd.print(“Rate:”);
lcd.print(runRate);

if (irrecv.decode(&results))

{
translateIR();
irrecv.resume();
}
}

void translateIR()
{
switch(results.value) {
{
case E8289565:
((score = score +=1) && (balls = balls +=1));
break;

case 66800DCD:
((score = score +=2) && (balls = balls +=1));
break;

case C03CA26F:
((score = score +=3) && (balls = balls +=1));

case 490541DF:
((score = score +=4) && (balls = balls +=1));
}
case B1CE824B:
((score = score +=5) && (balls = balls +=1));
}
case 6F6EBBF3:
((score = score +=6) && (balls = balls +=1));
}
}

Hello and welcome,

If those are hex values, you must prefix them with "0x" to tell the compiler that this number is written in hex notation.

case 0xE8289565:

This is so wrong:

((score = score +=2) && (balls = balls +=1));

What do you expect this line (and the others similar lines) to do?

Just do

score += 2;
balls ++;

Each switch case must end with break;

Also remove the few unnecessary brackets.

Thankyou very much Guix, i will try that and hopefully it works. Thanks for the other tip aswell, it will make it a lot neater. It does work though as i tried it with serial monitor rather than my ir remote and it dit what i wanted. Thanks Darcey

Yes it may work, but it's confusing and not the right way to write it. It looks like an if statement where you just removed 'if' and replaced comparisons with assignments.

a += bis the same as doinga = a + bboth are perfectly fine, buta = a += bisn't, even if it works ;)

What it does, if you decompose it, is:

a += b; // ok
a = a; // useless

Thanks very much :)

Hello, also just wondering if it is possible to include brackets in arduino algorithms eg.

runRate = 6 * balls / score;
runRate = (6 * balls) / score;

Im not sure if it is not possible or there is a special way to do it. Im not sure if you understand cricket but the runrate must be updated at every ball, i had it working before but it only updated every over. Thanks Darcey

That is possible, but it doesn't change anything in that particular statement.

Delta_G: That is possible, but it doesn't change anything in that particular statement.

Thanks for the reply, sorry, i didnt explain it very well. I want to wrap brackets around that part as in mathematical brackets. I know what i showed as an example doesn't do anything, but i would like to surround that part with mathematical brackets, without brackets the 'runRate' is wrong. Thanks

If runrate was wrong without the parenthesis then it will be wrong with them in that example. The order of operations without the parenthesis is the same as with them in that example. Here's an example where they would be different:

int val = varA + varB * varC;

Here the multiplication is done before the addition.

int val = (varA + varB) * varC;

Here the addition is done first to clear the parenthesis.