Skip to content

Commit

Permalink
Fixed Msb/Lsb/Xlsb build up for raw temperature acquisition. (only fo…
Browse files Browse the repository at this point in the history
…r first example - not for optimized version of code)
  • Loading branch information
mnr committed Dec 10, 2023
1 parent 62589bb commit d2f0af6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vignettes/articles/i2cbme280.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ return T;
}')
# read the temperature
raw_temperature <- bitwShiftL(rpi_i2c_get(BME280_location, BME280_temp, "w"),4) + bitwShiftR(rpi_i2c_get(BME280_location, BME280_temp + 2, "b"),4)
MsbLsb <- bitwShiftL(rpi_i2c_get(BME280_location, BME280_temp, "w"),4)
xlsb <- rpi_i2c_get(BME280_location, BME280_temp + 2, "b")
raw_temperature <- bitwOr(MsbLsb, xlsb)
# call the temperature compensation function just compiled
dig_T1_value <- rpi_i2c_get(BME280_location, dig_T1_reg, "w")
dig_T2_value <- rpi_i2c_get(BME280_location, dig_T2_reg, "w")
Expand Down

0 comments on commit d2f0af6

Please sign in to comment.