We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f10a895 + f899032 commit 7b645b7Copy full SHA for 7b645b7
libraries/Camera/examples/CameraCaptureRawBytes/CameraCaptureRawBytes.ino
@@ -64,11 +64,16 @@ void loop() {
64
while(!Serial);
65
}
66
67
- // Time out after 2 seconds and send new data
+ // Time out after 2 seconds, which sets the (constant) frame rate
68
bool timeoutDetected = millis() - lastUpdate > 2000;
69
70
- // Wait for sync byte.
71
- if(!timeoutDetected && Serial.read() != 1) return;
+ // Wait for sync byte and timeout
+ // Notice that this order must be kept, or the sync bytes will be
72
+ // consumed prematurely
73
+ if ((!timeoutDetected) || (Serial.read() != 1))
74
+ {
75
+ return;
76
+ }
77
78
lastUpdate = millis();
79
0 commit comments