mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 16:37:52 +01:00
fix calibration (#1103)
This commit is contained in:
parent
c041cc483c
commit
78633c5768
@ -120,7 +120,7 @@ void INA219Component::setup() {
|
||||
}
|
||||
|
||||
this->calibration_lsb_ = lsb;
|
||||
auto calibration = uint32_t(0.04096f / (0.0001 * lsb * this->shunt_resistance_ohm_));
|
||||
auto calibration = uint32_t(0.04096f / (0.000001 * lsb * this->shunt_resistance_ohm_));
|
||||
ESP_LOGV(TAG, " Using LSB=%u calibration=%u", lsb, calibration);
|
||||
if (!this->write_byte_16(INA219_REGISTER_CALIBRATION, calibration)) {
|
||||
this->mark_failed();
|
||||
|
Loading…
Reference in New Issue
Block a user