• problem is that it's called in interval and there is a high chance that during the day LED may flash in between the checks.
    I still want to capture the LED flash, which is done through setWatch.

    Yes, that's fine. I should still work - and as far as I understand you tested and it does work?

    Why there was pinmode set in the original code before the setWatch? Maybe it's a key to my understanding

    As I said above, the pullup is enabled because it's like a 'potential divider'. When the light level is low, LDR resistance is high and the voltage on the pin goes high. When you have light, LDR resistance is low and it pulls the pin voltage low.

    But I'm sorry, I'm really busy this week and I can't spend any more time walking you through the code. I think I've already covered what it does line by line in every circumstance

About

Avatar for Gordon @Gordon started