I have an Arduino vehicle and I upload projects to it that I want them to function once I use a strong light on a light sensor attached to A4 analog pin. So far, I have used the following code:
void setup() {
while (analogRead(A4) < 900) {}
}
void loop() {
// do something with the vehicle
}
I know it's a bad design, but there's a limitation that I can't use the loop() function for this (it's actually a limitation of a specific IDE usage scenario), I need to do it in the setup() function, so I would like to know if I'm doing any harm to Arduino or the light sensor by using the previous code. Should I also use delay() or millis() in this while loop? The sensing of the strong light doesn't have to be accurate.