revert change + version bump
All checks were successful
Test compiling project / test (push) Successful in 2m41s
All checks were successful
Test compiling project / test (push) Successful in 2m41s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user