Sorry if this was already asked, I was not able to find anything similar to my project.
So I have a system that has a break beam sensor that detect the motion of a prosthetic hand that is being operated by a servo. We are testing for failure with making the hand grip back and forth (so the sensor will show broken-unbroken-broken,etc throughout the experiment)
What I am looking for is that when the sensor detects broken for a certain amount of time (say 5 minutes) means that the hand failed and the servo should stop. I was wondering if this is possible and how would I do the code (I have the code for the break beam and the servo separately).
Also sorry if this is not the right forum, I am a bit new to this.