-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
029b8f6
commit 0bc3fa2
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
19 changes: 12 additions & 7 deletions
19
libraries/Portenta_Camera/examples/Envie_camera/Envie_camera.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |