!7 lib 1008985 // webcam lib 1008987 // bridj lib 1004016 // slf4j api import com.github.sarxos.webcam.Webcam; import com.github.sarxos.webcam.WebcamMotionDetector; import com.github.sarxos.webcam.WebcamMotionEvent; import com.github.sarxos.webcam.WebcamMotionListener; /** * Detect motion. This example demonstrates how to use build-in motion detector * and motion listener to fire motion events. * * @author Bartosz Firyn (SarXos) */ sclass DetectMotionExample implements WebcamMotionListener { *() { WebcamMotionDetector detector = new(Webcam.getDefault()); detector.setInterval(500); // one check per 500 ms detector.addMotionListener(this); detector.start(); } @Override public void motionDetected(WebcamMotionEvent wme) { print("Detected motion I, alarm turn on you have"); } } p { new DetectMotionExample; }