Skip to content

Commit

Permalink
Fix writing to wrong addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
SantaClaas committed Sep 15, 2023
1 parent a1898ee commit a432ee6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/temperatureSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ export async function writeAddress(
// Function
view.setUint8(1, FunctionCode.WriteSingleHoldingRegister);
// Register address
view.setUint16(2, HoldingRegisterAddress.HumidityCorrectionValue);
view.setUint16(2, HoldingRegisterAddress.DeviceAddress);
// Register value
view.setUint16(4, newAddress);
// CRC
Expand Down Expand Up @@ -591,7 +591,7 @@ export async function writeBaudRate(
// Function
view.setUint8(1, FunctionCode.WriteSingleHoldingRegister);
// Register address
view.setUint16(2, HoldingRegisterAddress.HumidityCorrectionValue);
view.setUint16(2, HoldingRegisterAddress.BaudRate);
// Register value
view.setUint16(4, baudRate);
// CRC
Expand Down

0 comments on commit a432ee6

Please sign in to comment.