sensor value Serial.println

Hi.
I want to print different values if the sensor value is more or less than a given number but this not seem to work so good.
The code is really just two if statements that check if the values is more or less than 800 but its only printing the first statement and does not care what the real value is.

What am I missing?

if(sensorValue < ‘800’)
Serial.println(“Less than 800”);

if(sensorValue > ‘800’)
Serial.println(“More than 800”);

you are missing the keys

if(sensorValue < '800')
{
     Serial.println("Less than 800");
}

if(sensorValue > '800')
{
     Serial.println("More than 800");
}

It still does not work. Really strange

3SPIN3T3:
you are missing the keys

if(sensorValue < '800')

{
     Serial.println(“Less than 800”);
}

if(sensorValue > ‘800’)
{
     Serial.println(“More than 800”);
}

You only need the { } if there’s more than one statement underneath.

mogren3000:
It still does not work. Really strange

Show all the code: maybe it’s the quotes? What kind of variable is sensorValue?

check the chapter about datatypes in C, especially int, char and char aray’s

if (sensorValue < 800)
{
     Serial.println("Less than 800");
}
else if (sensorValue > 800)
{
     Serial.println("More than 800");
}
else  Serial.println("Equals 800");

sensorValue is an int so as you suggested it should be without. If I have anything else it wont follow the standard.
And now its working. THanks

char oneChar = 'a';
char array[10] = "Arduino"; // double quotes + there should at least be one place for a terminating 0
int x = 800;

mogren3000:
And now its working. THanks

Good stuff. But Rob makes a good point: your code doesn't cater for the sensor being equal to 800.