Skip to content

Commit 83160bd

Browse files
committed
Portenta_Camera: rename examples
1 parent 57ae809 commit 83160bd

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

libraries/Portenta_Camera/examples/Envie_cameraMD/Envie_cameraMD.ino renamed to libraries/Portenta_Camera/examples/CameraMotionDetect/CameraMotionDetect.ino

+9-6
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@ void setup() {
1818
// Init the cam QVGA, 30FPS
1919
cam.begin(CAMERA_R320x240, 60);
2020

21-
cam.setMDThreshold(100, 200);
22-
cam.setMDWindow(0, 0, 320, 240);
23-
cam.enableMD(true, on_motion);
21+
cam.motionDetectionThreshold(100, 200);
22+
cam.motionDetectionWindow(0, 0, 320, 240);
23+
// The detection can also be enabled without any callback
24+
cam.motionDetection(true, on_motion);
2425
}
2526

2627
void loop() {
27-
// put your main code here, to run repeatedly:
28+
2829
if (motion_detected) {
2930
Serial.printf("Motion Detected!\n");
3031
digitalWrite(LEDB, LOW);
3132
delay(500);
32-
cam.clearMDFlag();
33-
motion_detected =false;
33+
34+
// Clear the detection flag
35+
cam.motionDetected();
36+
motion_detected = false;
3437
digitalWrite(LEDB, HIGH);
3538
}
3639
delay(10);

0 commit comments

Comments
 (0)