added camera_present

pico-v0.23
alanbjohnston 3 years ago committed by GitHub
parent 5fb8a3efd8
commit d05473cf6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -70,7 +70,19 @@ bool start_camera() {
#endif
LittleFS.begin();
return(get_camera_image());
bool camera_present = false;
int tries = 0;
while ((tries++ < 5) && !camera_present) {
if (get_camera_image()) {
camera_present = true;
Serial.println("Camera detected!");
}
}
if !camera_present {
Serial.println("No camera detected!");
}
return(camera_present);
}
void show_dir2() {

Loading…
Cancel
Save

Powered by TurnKey Linux.