Re: Time limit while waiting for input ?
is it possible to have a time limit on how long to wait for that low input and if it doesn't happen, the timer will effectively provide the low and the program can continue just as if the sensor worked ?
the code I posted in this link
http://www.picbasic.co.uk/forum/show...ht=#post136604
effectively does this. that's what "run_count" is all about
when the motor is moving the limit switches are checked every so many mS and the run count decremented
if a limit is reached or the run count reaches 0 then movement is terminated.
a run count of 2000 @ 50mS = 100 seconds till timeout
or
a run count of 185 @ 100mS = 18.5 seconds till timeout , simply adjust to suit
Last edited by richard; - 3rd July 2017 at 02:37.
Warning I'm not a teacher
Bookmarks