Skip to content

Commit

Permalink
Issue #38
Browse files Browse the repository at this point in the history
Corrected excess-128 trim value range
  • Loading branch information
SV-Zanshin authored and SV-Zanshin committed Jan 18, 2019
1 parent 518b476 commit 1db011b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MCP7940.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ int8_t MCP7940_Class::calibrate(const float fMeas) { //
trim += ((fMeas-(float)fIdeal) * (32768.0/fIdeal) * 60.0) / 2.0; // Use formula from datasheet //
if (trim > 127) { // Force number ppm to be in range //
trim = 127; // //
} else if (trim < -128) { // check for low out-of-bounds too //
trim = -128; // //
} else if (trim < -127) { // check for low out-of-bounds too //
trim = -127; // //
} // of if-then-else trim out of range // //
trim = calibrate(trim); // Set the new trim value //
return(trim); // //
Expand Down

0 comments on commit 1db011b

Please sign in to comment.