From 323ea18fb458fe3006c708c74fec6f708d760dcc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 2 Jul 2022 23:44:37 -0400 Subject: [PATCH] Update cubesatsim.ino --- cubesatsim/cubesatsim.ino | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index d4a39752..0ad79520 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -1449,11 +1449,20 @@ void read_ina219() float current_mA = 0; float loadvoltage = 0; - shuntvoltage = ina219_2_0x44.getShuntVoltage_mV(); - busvoltage = ina219_2_0x44.getBusVoltage_V(); - current_mA = ina219_2_0x44.getCurrent_mA(); + shuntvoltage = ina219_1_0x40.getShuntVoltage_mV(); + busvoltage = ina219_1_0x40.getBusVoltage_V(); + current_mA = ina219_1_0x40.getCurrent_mA(); loadvoltage = busvoltage + (shuntvoltage / 1000); + Serial.print("1 0x40 Voltage: "); + Serial.print(loadvoltage); + Serial.print("V Current: "); + Serial.print(current_mA); + Serial.println(" mA"); + + voltage[0] = loadvoltage; + current[0] = current_ma; + } void read_sensors()