Takes a picture when motion is detected