revert change + version bump
All checks were successful
Test compiling project / test (push) Successful in 2m41s

This commit is contained in:
2025-03-23 18:27:16 +01:00
parent d73b2c66cd
commit 82455c830f
2 changed files with 3 additions and 12 deletions

View File

@@ -116,17 +116,8 @@ float INA233::getBusVoltage() {
}
float INA233::getShuntVoltage() {
int16_t rawVoltage = get_word(INA233::_address, REGISTER_READ_VSHUNT); // Read raw voltage (16-bit register)
// Convert from two's complement to an integer value
// If the MSB (most significant bit) is set, the number is negative
if (rawVoltage & 0x8000) { // Check if MSB (bit 15) is set
rawVoltage = rawVoltage - 0x10000; // Convert two's complement negative number
}
// Convert value according to the datasheet
// LSB: 2.5 μV per bit -> Multiply by 2.5e-6 to convert to volts
float voltage = rawVoltage * 2.5e-6;
uint16_t rawVoltage = get_word(INA233::_address, REGISTER_READ_VSHUNT);
float voltage = rawVoltage * pow(10,-4);
return voltage;
}

View File

@@ -7,7 +7,7 @@
#define water_level_min_key "water_level_min"
#define water_level_max_key "water_level_max"
#define water_volume_key "water_volume"
#define current_software_version Version{1, 1, 0}
#define current_software_version Version{1, 2, 0}
#define REQUIRED_SPIFFS_VERSION Version{8, 0, 0}
#define RESISTOR_VALUE 4