From a1985178cc3b5074fd019b3f7d07e4726d1377b5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 3 Feb 2025 16:21:53 -0500 Subject: [PATCH] Update main.c --- main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 9e47c212..79051464 100644 --- a/main.c +++ b/main.c @@ -526,7 +526,10 @@ int main(int argc, char * argv[]) { sin_samples = S_RATE/freq_Hz; for (int j = 0; j < sin_samples; j++) { - sin_map[j] = (short int)(amplitude * sin((float)(2 * M_PI * j / sin_samples))); + sin_map[j] = (short int)(amplitude * sin((float)(2 * M_PI * j / sin_samples))); + + FILE * delete_image = popen("sudo rm /home/pi/CubeSatSim/image_file.bin", "r"); // delete any previous camera images + pclose(delete_image); } printf("\n"); } @@ -2323,13 +2326,13 @@ void get_tlm_fc() { // FunCube Mode telemetry generation source_bytes[1] = 0x10 ; // extended JY-1 - works, no documentation int extended = 1; - if (sequence > 10) { +// if (sequence > 10) { if (image_file == NULL) { image_file = fopen("/home/pi/CubeSatSim/image_file.bin", "r"); image_id++; printf("Opening file image_file.bin for image_id: %d\n", image_id); } - } +// } int pos = 56; // 56 // source_bytes[pos++] = 0x55; // source_bytes[pos++] = 0x68; @@ -2338,7 +2341,7 @@ void get_tlm_fc() { // FunCube Mode telemetry generation printf("Writing image data to payload\n"); while ((pos < 256) && ((value = getc(image_file)) != EOF)) { source_bytes[pos++] = value; - printf("%2x ", value); +// printf("%2x ", value); } if (value == EOF) { image_file = NULL;