From 17e85c6ddfb5dc46eb1bd3d886073b64b30694a2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 15 Feb 2023 17:27:18 -0500 Subject: [PATCH] add bitmap --- cubesatsim/esp32-cam/esp32-cam.ino | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/cubesatsim/esp32-cam/esp32-cam.ino b/cubesatsim/esp32-cam/esp32-cam.ino index dfcd43eb..89d6dd76 100644 --- a/cubesatsim/esp32-cam/esp32-cam.ino +++ b/cubesatsim/esp32-cam/esp32-cam.ino @@ -13,8 +13,8 @@ static esp_err_t init_camera(); #define FORMAT_SPIFFS_IF_FAILED true camera_fb_t *pic; -//File inFile; -//File outFile; +SSTV_config_t* currentSSTV; +uint8_t* bitmap; void setup() { // put your setup code here, to run once: @@ -28,6 +28,8 @@ void setup() { if (init_camera() == ESP_OK) { + + bitmap = (uint8_t*) malloc (320 * 256 * 3 + 200); config_camera(); @@ -66,9 +68,19 @@ void loop() { */ // listDir(SPIFFS, "/", 0); - char filename[] = "/cam.bin"; +/// char filename[] = "/cam.bin"; - save_camera_image(filename); +/// save_camera_image(filename); + + pic = esp_camera_fb_get(); + + if (!pic) + { + Serial.println("Failed to get camera image!"); + delay(10000); + return; + } + bitmap = pic->buf; picosstvpp();