added camera_detected

pull/182/head
alanbjohnston 3 years ago committed by GitHub
parent 9dabdfab87
commit cc64cef990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,8 +61,8 @@ WiFiClient client;
byte green_led_counter = 0; byte green_led_counter = 0;
char call[] = "AMSAT"; // put your callsign here char call[] = "AMSAT"; // put your callsign here
extern void get_camera_image(); extern bool get_camera_image();
extern void start_camera(); extern bool start_camera();
void setup() { void setup() {
@ -133,8 +133,15 @@ void setup() {
} }
*/ */
// start_button_isr(); // start_button_isr();
setup_sstv(); setup_sstv();
start_camera(); if (start_camera()) {
camera_detected = true;
Serial.println("Camera detected!");
} else
camera_detected = false;
Serial.println("No camera detected!");
}
start_isr(); start_isr();
start_pwm(); start_pwm();
@ -185,18 +192,19 @@ void loop() {
else if (mode == SSTV) else if (mode == SSTV)
{ {
char image_file[128]; char image_file[128];
// if (first_time_sstv) { if (first_time_sstv) {
if (false) { // turn this off for now // if (false) { // turn this off for now
strcpy(image_file, sstv1_filename); strcpy(image_file, sstv1_filename);
first_time_sstv = false; first_time_sstv = false;
} else { } else {
Serial.println("Getting image file"); if (camera_detected) {
get_camera_image(); Serial.println("Getting image file");
Serial.println("Got image file"); get_camera_image();
char camera_file[] = "/cam.jpg"; // Serial.println("Got image file");
strcpy(image_file, camera_file); char camera_file[] = "/cam.jpg";
strcpy(image_file, camera_file);
// strcpy(image_file, sstv2_filename); // 2nd stored image } else
strcpy(image_file, sstv2_filename); // 2nd stored image
} }
if (debug_mode) { if (debug_mode) {
Serial.print("\nSending SSTV image "); Serial.print("\nSending SSTV image ");

Loading…
Cancel
Save

Powered by TurnKey Linux.