File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 131131MAGGAIN_8GAUSS = (0b01 << 5 ) # +/- 8 gauss
132132MAGGAIN_12GAUSS = (0b10 << 5 ) # +/- 12 gauss
133133MAGGAIN_16GAUSS = (0b11 << 5 ) # +/- 16 gauss
134- GYROSCALE_245DPS = (0b00 << 4 ) # +/- 245 degrees/s rotation
135- GYROSCALE_500DPS = (0b01 << 4 ) # +/- 500 degrees/s rotation
136- GYROSCALE_2000DPS = (0b11 << 4 ) # +/- 2000 degrees/s rotation
134+ GYROSCALE_245DPS = (0b00 << 3 ) # +/- 245 degrees/s rotation
135+ GYROSCALE_500DPS = (0b01 << 3 ) # +/- 500 degrees/s rotation
136+ GYROSCALE_2000DPS = (0b11 << 3 ) # +/- 2000 degrees/s rotation
137137# pylint: enable=bad-whitespace
138138
139139
@@ -242,13 +242,13 @@ def gyro_scale(self):
242242 - GYROSCALE_2000DPS
243243 """
244244 reg = self ._read_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G )
245- return (reg & 0b00110000 ) & 0xFF
245+ return (reg & 0b00011000 ) & 0xFF
246246
247247 @gyro_scale .setter
248248 def gyro_scale (self , val ):
249249 assert val in (GYROSCALE_245DPS , GYROSCALE_500DPS , GYROSCALE_2000DPS )
250250 reg = self ._read_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G )
251- reg = (reg & ~ (0b00110000 )) & 0xFF
251+ reg = (reg & ~ (0b00011000 )) & 0xFF
252252 reg |= val
253253 self ._write_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G , reg )
254254 if val == GYROSCALE_245DPS :
You can’t perform that action at this time.
0 commit comments