Arduino - My problem is when the condition is greater than 900.00 it will continue the loop and do the code below once
setup(){ ....
......
}
float old_reading=0;
loop() {
float reading = analogRead(LIGHTSENSORPIN); //Read light level
// ... do this always (maybe empty) 
// in your code it is LED shining and printing
if ((old_reading&lt;=900) &amp;&amp; (reading&gt;900)) {
   // ... do this just just once when reading goes over 900 up
   // in your code it is manipulating motor
   }
old_reading=reading;
// ... do this always , but after special part (maybe empty)
// in your code it is just delay
}



So on begining old_reading is just zero, but being declared outside loop, it keeps its value between different runs of loop. 
the if (condition) does not hit, as reading is less than 900 (if it starts with more then 900, see next part) 
the end with old_reading=reading; makes old_reading to be the last known value of reading
when reading goes Greater than 900 for first time, the old_reading is Less or Equal 900 (as it was the last value of reading before it crossed 900 up. 

so the if (condiotion) is true and you start moving motor


then (on the end) you set old_reading=reading; and old_reading is also larger then 900


while reading stays over 900 in next loops, the old_reading does so, and therefore the if (condition) does not hit - (old_reading&lt;=900) is not true


when reading falls down 900 or lower, the if(condition) also does not hit, but after that the old_reading=reading; makes old_reading less or equal 900

and so we are at the start again, skipping the part after if(condition) until reading gets Greater than 900 (then we run motor, set old_reading to something greater than 900 and we already was here and know, how it works :)