From 07ebf90f4bd4a739fd55b4acca00a69cbbaaeb23 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 26 Feb 2023 18:24:39 -0500 Subject: [PATCH] Update cubesatsim.ino --- cubesatsim/cubesatsim.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 5c4a34ae..cda2f114 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -911,6 +911,12 @@ void config_simulated_telem() tempS = rand_float(20, 55); temp_max = rand_float(50, 70); temp_min = rand_float(10, 20); + + time_start = (long int) millis(); + + eclipse_time = (long int)(millis() / 1000.0); + if (eclipse == 0.0) + eclipse_time -= period / 2; // if starting in eclipse, shorten interval // #ifdef DEBUG_LOGGING for (int i = 0; i < 3; i++) @@ -918,11 +924,7 @@ void config_simulated_telem() Serial.printf("batt: %f speed: %f eclipse_time: %f eclipse: %f period: %f temp: %f max: %f min: %f\n", batt, rotation_speed, eclipse_time, eclipse, period, tempS, temp_max, temp_min); // #endif - time_start = (long int) millis(); - eclipse_time = (long int)(millis() / 1000.0); - if (eclipse == 0.0) - eclipse_time -= period / 2; // if starting in eclipse, shorten interval // } // tx_freq_hz -= tx_channel * 50000;