lundi 13 avril 2020

Print Stop after a button been pushed down for 3 secs on Python

I trying to write a code for face detection where the camera detects how long you closed your eye for. My code suppose to print "buzzer" if my eyes close for longer than 3 secs. I got most of the code done but I am using threading timer to print out "buzzer" everytime I close my eye. Thus, if my eye is detected do not do anything if it is not print "buzzer". But the threading only delays the print command 3 sec. I do not want my code to print anything if my eyes are closed less than 3 secs. The title of the question is the closest concept I can get that simplifies my code and give me an idea to find a solution. The part of code I am trying to work on is after line #99 shown in the picture

Aucun commentaire:

Enregistrer un commentaire