added I2C sensor problem print if longer than 1 second

pico-i2c
alanbjohnston 3 years ago committed by GitHub
parent 1eca4121f1
commit ccb32201c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2205,6 +2205,8 @@ void test_radio()
void read_ina219() void read_ina219()
{ {
unsigned long read_time = millis();
if (voltage_read && !i2c_bus1 && !i2c_bus3) if (voltage_read && !i2c_bus1 && !i2c_bus3)
Serial.println("Nothing to read"); Serial.println("Nothing to read");
/* /*
@ -2375,6 +2377,9 @@ void read_ina219()
current[MINUS_Z] = 0.0; current[MINUS_Z] = 0.0;
} }
voltage_read = false; voltage_read = false;
if ((millis() - read_time) > 1000)
Serial.println("There is an I2C sensor problem");
} }
void read_sensors() void read_sensors()

Loading…
Cancel
Save

Powered by TurnKey Linux.