We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 275e2fd commit fbfd869Copy full SHA for fbfd869
libraries/Portenta_Camera/examples/CameraCaptureRawBytes/CameraCaptureRawBytes.ino
@@ -4,19 +4,22 @@ CameraClass cam;
4
uint8_t fb[320*240];
5
6
void setup() {
7
-
8
- Serial.begin(921600);
+ Serial.begin(921600);
9
10
// Init the cam QVGA, 30FPS
11
cam.begin(CAMERA_R320x240, 30);
12
}
13
14
void loop() {
15
// put your main code here, to run repeatedly:
16
- if (Serial) {
17
- // Grab frame and write to serial
18
- if (cam.grab(fb) == 0) {
19
- Serial.write(fb, 320*240);
20
- }
+
+ // Wait until the receiver acknowledges
+ // that they are ready to receive new data
+ while(Serial.read() != 1){};
+ // Grab frame and write to serial
21
+ if (cam.grab(fb) == 0) {
22
+ Serial.write(fb, 320*240);
23
24
25
0 commit comments