Skip to content

Commit

Permalink
Update lm75bd.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Dibadi1384 authored Oct 16, 2024
1 parent 4714090 commit 534fc4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lm75bd/lm75bd.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ error_code_t readTempLM75BD(uint8_t devAddr, float *temp) {
RETURN_IF_ERROR_CODE(i2cReceiveFrom(devAddr, buf, sizeof(buf)));

// Extract 11-bit data from the 2 bytes received
int16_t tempRaw = ((buf[0]<<8|buff[1])>>5);
int16_t tempRaw = ((buf[0]<<8|buf[1])>>5);

// Calculate two's complement for negative temperatures
if (tempRaw & (1 << 10)) {
Expand Down

0 comments on commit 534fc4f

Please sign in to comment.