Skip to content

Commit d74ada2

Browse files
committed
Update Arduino example sketch.
1 parent 5a44506 commit d74ada2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
12
#include "camera.h"
23

34
CameraClass cam;
5+
uint8_t fb[320*240] __attribute__((aligned(32)));
46

57
void setup() {
68

7-
Serial.begin(115200);
8-
//while (!Serial);
9+
Serial.begin(921600);
10+
11+
// Init the cam
12+
cam.begin(320, 240);
913

10-
// put your setup code here, to run once:
11-
cam.begin(324, 244);
12-
cam.start();
13-
//cam.testPattern(true);
14+
// Skip 60 frames
15+
cam.skip_frames(fb, 60);
1416
}
1517

1618
void loop() {
1719
// put your main code here, to run repeatedly:
1820
if (Serial) {
19-
Serial.write(cam.grab(), 324 * 244);
21+
// Grab frame and write to serial
22+
if (cam.grab(fb) == 0) {
23+
Serial.write(fb, 320*240);
24+
}
2025
}
2126
}

0 commit comments

Comments
 (0)