|
|
|
|
@ -2255,7 +2255,7 @@ void test_radio()
|
|
|
|
|
void read_ina219()
|
|
|
|
|
{
|
|
|
|
|
unsigned long read_time = millis();
|
|
|
|
|
|
|
|
|
|
unsigned long read_time_total = millis();
|
|
|
|
|
if (voltage_read && !i2c_bus1 && !i2c_bus3)
|
|
|
|
|
Serial.println("Nothing to read");
|
|
|
|
|
/*
|
|
|
|
|
@ -2472,10 +2472,10 @@ void read_ina219()
|
|
|
|
|
current[MINUS_Z] = 0.0;
|
|
|
|
|
}
|
|
|
|
|
voltage_read = false;
|
|
|
|
|
/*
|
|
|
|
|
if ((millis() - read_time) > 1000) {
|
|
|
|
|
|
|
|
|
|
if ((millis() - read_time_total) > 1000) {
|
|
|
|
|
Serial.println("There is an I2C sensor problem");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if (!(i2c_1 = ina219_1_0x40.begin())) // check i2c bus 1
|
|
|
|
|
Serial.println("I2C +X sensor (bus 1 0x40) not found");
|
|
|
|
|
if (!(i2c2 = ina219_1_0x41.begin()))
|
|
|
|
|
|