1
- # The MIT License (MIT)
1
+ # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
2
2
#
3
- # Copyright (c) 2017 Tony DiCola for Adafruit Industries
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # SPDX-License-Identifier: MIT
4
+
22
5
"""
23
6
`adafruit_lsm9ds1`
24
7
====================================================
@@ -183,10 +166,10 @@ def __init__(self):
183
166
@property
184
167
def accel_range (self ):
185
168
"""The accelerometer range. Must be a value of:
186
- - ACCELRANGE_2G
187
- - ACCELRANGE_4G
188
- - ACCELRANGE_8G
189
- - ACCELRANGE_16G
169
+ - ACCELRANGE_2G
170
+ - ACCELRANGE_4G
171
+ - ACCELRANGE_8G
172
+ - ACCELRANGE_16G
190
173
"""
191
174
reg = self ._read_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG6_XL )
192
175
return (reg & 0b00011000 ) & 0xFF
@@ -210,10 +193,10 @@ def accel_range(self, val):
210
193
@property
211
194
def mag_gain (self ):
212
195
"""The magnetometer gain. Must be a value of:
213
- - MAGGAIN_4GAUSS
214
- - MAGGAIN_8GAUSS
215
- - MAGGAIN_12GAUSS
216
- - MAGGAIN_16GAUSS
196
+ - MAGGAIN_4GAUSS
197
+ - MAGGAIN_8GAUSS
198
+ - MAGGAIN_12GAUSS
199
+ - MAGGAIN_16GAUSS
217
200
"""
218
201
reg = self ._read_u8 (_MAGTYPE , _LSM9DS1_REGISTER_CTRL_REG2_M )
219
202
return (reg & 0b01100000 ) & 0xFF
@@ -237,9 +220,9 @@ def mag_gain(self, val):
237
220
@property
238
221
def gyro_scale (self ):
239
222
"""The gyroscope scale. Must be a value of:
240
- - GYROSCALE_245DPS
241
- - GYROSCALE_500DPS
242
- - GYROSCALE_2000DPS
223
+ - GYROSCALE_245DPS
224
+ - GYROSCALE_500DPS
225
+ - GYROSCALE_2000DPS
243
226
"""
244
227
reg = self ._read_u8 (_XGTYPE , _LSM9DS1_REGISTER_CTRL_REG1_G )
245
228
return (reg & 0b00011000 ) & 0xFF
0 commit comments