From c7fecd956c95b1cdf6f6153239fe526f50492f6e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 8 Dec 2020 16:55:34 -0500 Subject: [PATCH] typo in time --- afsk/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index e174ba6e..2b95ce9e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -423,7 +423,7 @@ amps_max[2] = 180.0 * (float) cos(angle[1] - angle[0]); batt = rnd_float(3.5, 4.3); speed = rnd_float(1.0, 2.5); -eclipse_time = rnd_float(0, 300); +//eclipse_time = rnd_float(0, 300); eclipse = (rnd_float(-1, +4) > 0) ? 1 : 0; period = rnd_float(150, 300); tempS = rnd_float(20, 55); @@ -436,9 +436,9 @@ printf("batt: %f speed: %f eclipse_time: %f eclipse: %d period: %f temp: %f max: time_start = millis(); - double eclipse_start = time; + eclipse_time = time; if (eclipse == 0) - eclipse_start -= period/2; // if starting in eclipse, shorten interval + eclipse_time -= period/2; // if starting in eclipse, shorten interval int ret; //uint8_t data[1024]; @@ -1031,10 +1031,10 @@ if (firstTime != ON) double time = (millis() - time_start)/1000.0; - if ((time - eclipse_start) > period) + if ((time - eclipse_time) > period) { eclipse = (eclipse == 1) ? 0 : 1; - eclipse_start = time; + eclipse_time = time; } // double Xi = 10.0 * sin(1.37) * sin(2.0 * 3.14 * time / (46.0 * 2)) + rnd_float(-1, 1);