Skip to content

Commit

Permalink
fixed bitShiftR by adding bitops
Browse files Browse the repository at this point in the history
  • Loading branch information
mnr committed Nov 30, 2023
1 parent 9a19507 commit 1268404
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vignettes/articles/Cookbook.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Here is code to read temperature, pressure, and humidity from the bme280 with i2
```{r, eval=FALSE}
library(rpigpior)
library(bitops)
getTemperature <- TRUE # ask BME280 for temperature?
getPressure <- TRUE # ask BME280 for barometric pressure?
Expand Down Expand Up @@ -224,7 +226,7 @@ if (getHumidity) {
data_size = "b"
)
dig_H5_msb <- H5_msb * 16
dig_H5_lsb <- bitwShiftRight(H5_lsb, 4)
dig_H5_lsb <- bitShiftR(H5_lsb, 4)
dig_H5 <- bitwOr(dig_H5_msb, dig_H5_lsb)
dig_H6 <- rpi_i2c_get(
Expand Down

0 comments on commit 1268404

Please sign in to comment.