Need some help please (simple question) (SOLVED)

Hi, excuse me for my lack of Aruduino programming skill. I'm trying to make the value in my "if" statement be a range. And this statement doesn't seem to work; if(photocellReading == > 240 )
What am i missing?

Program:
int photocellPin = 0; // the cell and 10K pulldown are connected to a0
int photocellReading; // the analog reading from the sensor divider
int LEDpin = 11; // connect Red LED to pin 11 (PWM pin)
int LEDbrightness; //
void setup(void) {

Serial.begin(9600);
pinMode (LEDpin, OUTPUT);
}

void loop(void) {
photocellReading = analogRead(photocellPin);
photocellReading = map(photocellReading, 500, 840, 0, 255);

if(photocellReading == > 240 ) {digitalWrite(LEDpin,HIGH);}
else { digitalWrite(LEDpin, LOW);}

Serial.print("Analog reading = ");
Serial.println(photocellReading);

delay(100);
}

 if(photocellReading == > 240 )

Really?
Look carefully - it isn't what you're missing, it's what you've got too much of

Please use code tags

AHHHH silly me, thankyou, should’nt be programming this late at night anyway…

= after = except before >. Stupid C

Maraos:
Hi, excuse me for my lack of Aruduino programming skill. I’m trying to make the value in my “if” statement be a range. And this statement doesn’t seem to work; if(photocellReading == > 240 )
What am i missing?

Examples:

    if (var == 240) // if variable is EQUAL to 240
    if (var < 240) // if variable is LESS THAN 240
    if (var <= 240) // if variable is LESS THAN OR EQUAL to 240
    if (var > 240) // if variable is GREATER THAN 240
    if (var >= 240) // if variable is GREATER THAN OR EQUAL to 240
    if (var != 240) // if variable is NOT EQUAL to 240
    if ((var < 100) || (var > 200)) // if variable is LESS THAN 100 OR GREATER THAN 200 (note 1)
    if ((var >= 100) && (var <= 200)) // if variable is GREATER THAN OR EQUAL TO 100 AND LESS THAN OR EQUAL TO 200 (note 2)

Note 1: This checks if variable is OUTSIDE the range of 100…200
Note 2: This checks if varialbe is INSIDE the range of 100…200

Hope this helps.

Thanks for all the help :smiley: