Hello guys, So i've got optic sensor which send 5V or 0V signal to my microsontroller for 15 seconds no matters if he sees something.
Now what i want to do:
I want to turn on lights when optic sensors sees someone or something and then lights should work for 60s. If in this 60 seconds something walk near sensor again it should restart the time and begin from 0. If nothing appears in 60seconds lights should turn off.
that's pretty complicated for me, i don't know what functions i should use bacause i'm not that good in this language.
Any help, code or some leads would be nice :)