From 7cae30bbb60f745f7aa7fd804182670f99a504dd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 22 Feb 2023 10:37:52 -0500 Subject: [PATCH] only check serial input every 10th time --- cubesatsim/cubesatsim.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index a44e1d11..aac0b656 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -65,6 +65,8 @@ Adafruit_SI5351 clockgen = Adafruit_SI5351(); unsigned long micros3; +int skip = 0; + //WiFiServer server(port); //WiFiClient client; WiFiClient net; @@ -340,7 +342,8 @@ void loop() { bool TimerHandler1(struct repeating_timer *t) { - serial_input(); + if (((skip++)%10) == 0) + serial_input(); // check for button press if (digitalRead(MAIN_PB_PIN) == PRESSED) // pushbutton is pressed