mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 08:55:22 +01:00
fix calibration (#1103)
This commit is contained in:
parent
c041cc483c
commit
78633c5768
1 changed files with 1 additions and 1 deletions
|
@ -120,7 +120,7 @@ void INA219Component::setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->calibration_lsb_ = lsb;
|
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);
|
ESP_LOGV(TAG, " Using LSB=%u calibration=%u", lsb, calibration);
|
||||||
if (!this->write_byte_16(INA219_REGISTER_CALIBRATION, calibration)) {
|
if (!this->write_byte_16(INA219_REGISTER_CALIBRATION, calibration)) {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
|
|
Loading…
Reference in a new issue