So I like to define a cubic area at where robot can move freely. But when robot is going outside that define cubic it should check that there is a dedicated input signal on. And if that signals drops down during movement outside this cubic. Robot need to stop.
I have define that cubic like this:
But how I can make that monitoring active all the time? Should I use interrupts or something else?