From 2ffd2da251bacfbbc4968dd34a14f9a1ab2755b7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 2 Jul 2022 06:37:03 -0400 Subject: [PATCH] Update cubesatsim.ino --- cubesatsim/cubesatsim.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index aef43e63..1c50630e 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -113,6 +113,8 @@ void setup() { void loop() { + loop_cnt++; + // query INA219 sensors and Payload sensors // encode as digits (APRS or CW mode) or binary (DUV FSK) @@ -200,7 +202,7 @@ void get_tlm_fox() { } if (mode == FSK) { - if (loop % 32 == 0) { // was 8 + if (loop_cnt % 32 == 0) { // was 8 /// was loop now loop_cnt printf("Sending MIN frame \n"); frm_type = 0x03; for (int count1 = 0; count1 < 17; count1++) { @@ -214,7 +216,7 @@ void get_tlm_fox() { sensor[count1] = sensor_min[count1]; } } - if ((loop + 16) % 32 == 0) { // was 8 + if ((loop_cnt + 16) % 32 == 0) { // was 8 printf("Sending MAX frame \n"); frm_type = 0x02; for (int count1 = 0; count1 < 17; count1++) {