Skip to content

Commit

Permalink
Merge pull request #9 from caternuson/iss4
Browse files Browse the repository at this point in the history
change property names
  • Loading branch information
tannewt committed Sep 13, 2018
2 parents 9cb1860 + 07843a1 commit e91510f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions adafruit_lsm9ds1.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def read_accel_raw(self):
return (raw_x, raw_y, raw_z)

@property
def accelerometer(self):
def acceleration(self):
"""The accelerometer X, Y, Z axis values as a 3-tuple of
m/s^2 values.
"""
Expand All @@ -292,7 +292,7 @@ def read_mag_raw(self):
return (raw_x, raw_y, raw_z)

@property
def magnetometer(self):
def magnetic(self):
"""The magnetometer X, Y, Z axis values as a 3-tuple of
gauss values.
"""
Expand All @@ -312,7 +312,7 @@ def read_gyro_raw(self):
return (raw_x, raw_y, raw_z)

@property
def gyroscope(self):
def gyro(self):
"""The gyroscope X, Y, Z axis values as a 3-tuple of
degrees/second values.
"""
Expand Down
6 changes: 3 additions & 3 deletions examples/lsm9ds1_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# values every second and print them out.
while True:
# Read acceleration, magnetometer, gyroscope, temperature.
accel_x, accel_y, accel_z = sensor.accelerometer
mag_x, mag_y, mag_z = sensor.magnetometer
gyro_x, gyro_y, gyro_z = sensor.gyroscope
accel_x, accel_y, accel_z = sensor.acceleration
mag_x, mag_y, mag_z = sensor.magnetic
gyro_x, gyro_y, gyro_z = sensor.gyro
temp = sensor.temperature
# Print values.
print('Acceleration (m/s^2): ({0:0.3f},{1:0.3f},{2:0.3f})'.format(accel_x, accel_y, accel_z))
Expand Down

0 comments on commit e91510f

Please sign in to comment.