From ccb32201c67c5302ab94bff5dc6727514da6a334 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 25 Sep 2022 11:41:39 -0400 Subject: [PATCH] added I2C sensor problem print if longer than 1 second --- cubesatsim/cubesatsim.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 6de46180..f7eb55a0 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -2205,6 +2205,8 @@ void test_radio() void read_ina219() { + unsigned long read_time = millis(); + if (voltage_read && !i2c_bus1 && !i2c_bus3) Serial.println("Nothing to read"); /* @@ -2375,6 +2377,9 @@ void read_ina219() current[MINUS_Z] = 0.0; } voltage_read = false; + + if ((millis() - read_time) > 1000) + Serial.println("There is an I2C sensor problem"); } void read_sensors()