Howdy folks, let me preface with this: I have very little experience with programming, but I am very interested in learning more about how all of this works! I am trying to utilize a light sensor for my current project and am not entirely sure how to go about it, or, if what I am trying to do is even possible. I tried to Google this before coming to the forum, but I'm not even sure what the right terms are for what I am trying to do, so bear with me!
This is the general idea: I want to run a light sensor that, when it detects light (from a laser), signals a green LED to turn on. When the laser shining on the sensor is obstructed however for more than 5 seconds, I would like it to turn on a red LED/activate a buzzer. The part I am struggling with though is: if the laser becomes unobstructed within the 5 second time frame, then the process for the red LED/buzzer being turned on is deactivated, and the green LED turns back on. Also, if the 5 seconds do pass, and the red LED/buzzer turns on and then the laser becomes unobstructed, the system resets back to its original point where only the green LED is running.
Is this possible, and if so, how might I go about this? I apologize if this isn't very clear, but I can try my best to answer any questions!
Thank you!