Skip to content

Commit

Permalink
Changed the order of multiplication to avoid overflow for int16 value (
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRed255 committed Apr 22, 2024
1 parent b6a1226 commit 8fec7e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion INA219.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ float INA219::getBusVoltage()
float INA219::getPower()
{
uint16_t value = _readRegister(INA219_POWER);
return value * 20 * _current_LSB;
return value * _current_LSB * 20;
}

// TODO CHECK
Expand Down

0 comments on commit 8fec7e3

Please sign in to comment.