@@ -188,11 +188,12 @@ def __init__(self, rng=L3DS20_RANGE_250DPS):
188
188
189
189
190
190
@property
191
- def acceleration (self ):
191
+ def gyro (self ):
192
192
"""
193
- x, y, z acceleration tuple floats, rescaled appropriately for range selected
193
+ x, y, z angular momentum tuple floats, rescaled appropriately for
194
+ range selected
194
195
"""
195
- raw = self .acceleration_raw
196
+ raw = self .gyro_raw
196
197
return tuple (self .scale * v for v in raw )
197
198
198
199
@@ -206,8 +207,8 @@ class L3GD20_I2C(L3GD20):
206
207
:param address: the optional device address, 0x68 is the default address
207
208
"""
208
209
209
- acceleration_raw = Struct (_L3GD20_REGISTER_OUT_X_L_X80 , '<hhh' )
210
- """Gives the raw acceleration readings, in units of the scaled mdps ."""
210
+ gyro_raw = Struct (_L3GD20_REGISTER_OUT_X_L_X80 , '<hhh' )
211
+ """Gives the raw gyro readings, in units of rad/s ."""
211
212
212
213
def __init__ (self , i2c , rng = L3DS20_RANGE_250DPS , address = 0x6B ):
213
214
import adafruit_bus_device .i2c_device as i2c_device
@@ -283,7 +284,7 @@ def read_register(self, register):
283
284
284
285
def read_bytes (self , register , buffer ):
285
286
"""
286
- Low level register streem reading over SPI, returns a list of values
287
+ Low level register stream reading over SPI, returns a list of values
287
288
288
289
:param register: the register to read bytes
289
290
:param bytearray buffer: buffer to fill with data from stream
@@ -295,8 +296,8 @@ def read_bytes(self, register, buffer):
295
296
spi .readinto (buffer )
296
297
297
298
@property
298
- def acceleration_raw (self ):
299
- """Gives the raw acceleration readings, in units of the scaled mdps ."""
299
+ def gyro_raw (self ):
300
+ """Gives the raw gyro readings, in units of rad/s ."""
300
301
buffer = self ._spi_bytearray6
301
302
self .read_bytes (_L3GD20_REGISTER_OUT_X_L_X40 , buffer )
302
303
return unpack ('<hhh' , buffer )
0 commit comments