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 131
131
MAGGAIN_8GAUSS = (0b01 << 5 ) # +/- 8 gauss
132
132
MAGGAIN_12GAUSS = (0b10 << 5 ) # +/- 12 gauss
133
133
MAGGAIN_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
137
137
# pylint: enable=bad-whitespace
138
138
139
139
@@ -242,13 +242,13 @@ def gyro_scale(self):
242
242
- GYROSCALE_2000DPS
243
243
"""
244
244
reg = self ._read_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G )
245
- return (reg & 0b00110000 ) & 0xFF
245
+ return (reg & 0b00011000 ) & 0xFF
246
246
247
247
@gyro_scale .setter
248
248
def gyro_scale (self , val ):
249
249
assert val in (GYROSCALE_245DPS , GYROSCALE_500DPS , GYROSCALE_2000DPS )
250
250
reg = self ._read_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G )
251
- reg = (reg & ~ (0b00110000 )) & 0xFF
251
+ reg = (reg & ~ (0b00011000 )) & 0xFF
252
252
reg |= val
253
253
self ._write_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G , reg )
254
254
if val == GYROSCALE_245DPS :
You can’t perform that action at this time.
0 commit comments