summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2021-11-30 11:55:16 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2021-11-30 11:55:16 -0500
commit473bd1637a9384ce155024e3bd46932ba096918f (patch)
treec87c1aebaea8096b644721c5f51546f68d39a6ce
parentaf27750a6d5fc946bc702531b88dc9f93ffd795c (diff)
downloadSensor-Watch-473bd1637a9384ce155024e3bd46932ba096918f.tar.gz
Sensor-Watch-473bd1637a9384ce155024e3bd46932ba096918f.tar.bz2
Sensor-Watch-473bd1637a9384ce155024e3bd46932ba096918f.zip
lis2dh driver: make the implicit explicit
-rw-r--r--watch-library/driver/lis2dh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/watch-library/driver/lis2dh.c b/watch-library/driver/lis2dh.c
index 24534481..2593fc69 100644
--- a/watch-library/driver/lis2dh.c
+++ b/watch-library/driver/lis2dh.c
@@ -34,8 +34,8 @@ bool lis2dh_begin() {
LIS2DH_CTRL1_VAL_YEN |
LIS2DH_CTRL1_VAL_ZEN |
LIS2DH_CTRL1_VAL_ODR_1HZ);
- // Enable block data update (output registers not updated until MSB and LSB have been read)
- watch_i2c_write8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL4, LIS2DH_CTRL4_VAL_BDU);
+ // Set range to ±2G and enable block data update (output registers not updated until MSB and LSB have been read)
+ watch_i2c_write8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL4, LIS2DH_CTRL4_VAL_BDU | LIS2DH_RANGE_2_G);
return true;
}