From d700eaeea7d548ce43bf6978582947f3e3b32dae Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 7 Jul 2022 09:37:10 -0400 Subject: [PATCH] Update cubesatsim.ino --- cubesatsim/cubesatsim.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 10db0ac5..fdd842b9 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -136,10 +136,14 @@ void loop() { // read_payload(); // encode as digits (APRS or CW mode) or binary (DUV FSK) - if ((mode == BPSK) || (mode == FSK)) - get_tlm_fox(); + if ((mode == BPSK) || (mode == FSK)) { + get_tlm_fox(); + while ((millis() - sampleTime) < ((unsigned int)samplePeriod - 250)) // was 250 100 + sleep(0.1); // 25); // 0.5); // 25); + sampleTime = (unsigned int) millis(); + } else if (mode == AFSK) - send_packet(); + send_packet(); // delay(2000); // test_radio(); @@ -537,7 +541,7 @@ void get_tlm_fox() { sampleTime = (unsigned int) millis(); } else { Serial.println("first time - short sleep"); - sleep(3.0); + // sleep(3.0); // firstTime = OFF; }