I am trying to make a simple Arduino code for when a photocell reading is less than 900, it will add 1 to the CurrentNumber and display it on a 4 digit 7 segment display. The problem is that it wont stop adding one even though it's reading more than 1000.
void loop() {
photocellReading = analogRead(photocellPin);
Serial.print("Analog reading = ");
Serial.println(photocellReading); // the raw analog reading
photocellReading = 1023 - photocellReading;
if(photocellReading << 10){
CurrentNumber = CurrentNumber + 1;
}
displayNumber(CurrentNumber);
}