Skip to content

Commit

Permalink
Correct typo of resistor
Browse files Browse the repository at this point in the history
  • Loading branch information
asukiaaa committed Feb 17, 2021
1 parent d8dd23e commit 4f99b8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/printVoltageAndCurrent/printVoltageAndCurrent.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <INA226_asukiaaa.h>

const uint16_t ina226calib = INA226_asukiaaa::calcCalibByResisterMilliOhm(2); // Max 5120 milli ohm
// const uint16_t ina226calib = INA226_asukiaaa::calcCalibByResisterMicroOhm(2000);
const uint16_t ina226calib = INA226_asukiaaa::calcCalibByResistorMilliOhm(2); // Max 5120 milli ohm
// const uint16_t ina226calib = INA226_asukiaaa::calcCalibByResistorMicroOhm(2000);
INA226_asukiaaa voltCurrMeter(INA226_ASUKIAAA_ADDR_A0_GND_A1_GND, ina226calib);

void setup() {
Expand Down
8 changes: 4 additions & 4 deletions src/INA226_asukiaaa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ void INA226_asukiaaa::setWire(TwoWire* wire) {
this->wire = wire;
}

uint16_t INA226_asukiaaa::calcCalibByResisterMilliOhm(uint16_t resisterMilliOhm) {
return calcCalibByResisterMicroOhm((uint32_t) resisterMilliOhm * 1000);
uint16_t INA226_asukiaaa::calcCalibByResistorMilliOhm(uint16_t resistorMilliOhm) {
return calcCalibByResistorMicroOhm((uint32_t) resistorMilliOhm * 1000);
}

uint16_t INA226_asukiaaa::calcCalibByResisterMicroOhm(uint32_t resisterMilliOhm) {
return (uint32_t) 5120 * 1000 / resisterMilliOhm;
uint16_t INA226_asukiaaa::calcCalibByResistorMicroOhm(uint32_t resistorMilliOhm) {
return (uint32_t) 5120 * 1000 / resistorMilliOhm;
}

int INA226_asukiaaa::begin() {
Expand Down

0 comments on commit 4f99b8f

Please sign in to comment.