I'm doing a home automation project.............now finding the code that can control on/off the led in certain period of time ( same as streetlight)........but cannot use delay function because I also can turn on/off manually.........thx for help
now finding the code
Well, I'm not finding your code.
With projects like this, you should expect to write the code for yourself, not 'find' it.
If you want to carry out timed actions and also control other things at the same time, you should use a non-blocking approach. The blink without delay example sketch demonstrates how to use that approach.