Stop print from scrolling

Welcome

Look at the example https://www.arduino.cc/en/Tutorial/BuiltInExamples/StateChangeDetection

This example is for buttons, but the idea can be applied for anything. Store the return value of motion_detect(), then compare with the previous value, only do the switch if the current value is different than the previous.