Skip to content

Commit

Permalink
Update Arduino example sketch.
Browse files Browse the repository at this point in the history
  • Loading branch information
iabdalkader committed Jan 15, 2021
1 parent 029b8f6 commit 0bc3fa2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions libraries/Portenta_Camera/examples/Envie_camera/Envie_camera.ino
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@

#include "camera.h"

CameraClass cam;
uint8_t fb[320*240] __attribute__((aligned(32)));

void setup() {

Serial.begin(115200);
//while (!Serial);
Serial.begin(921600);

// Init the cam
cam.begin(320, 240);

// put your setup code here, to run once:
cam.begin(324, 244);
cam.start();
//cam.testPattern(true);
// Skip 60 frames
cam.skip_frames(fb, 60);
}

void loop() {
// put your main code here, to run repeatedly:
if (Serial) {
Serial.write(cam.grab(), 324 * 244);
// Grab frame and write to serial
if (cam.grab(fb) == 0) {
Serial.write(fb, 320*240);
}
}
}

0 comments on commit 0bc3fa2

Please sign in to comment.