Hi Terry,

> >     i = sensor_test_loops_out
> >
> >     while i >= 0:
> >         i = i -1
> >         if not GPIO.input(sensor_b):
> >             time.sleep(sensor_pause_time)
> >         else:
> >             print ("Sensor B Activated")
> >             break 
>
> Unless I am battier than I thought, the while loop should continue
> until the signal goes low.  Any dissenters?

Or until sensor_test_loops_out is less than zero.
And for all the reader knows, it may start less than zero.  :-)

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2026-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  https://dorset.lug.org.uk
  New thread, don't hijack:  mailto:[email protected]

Reply via email to