Skip to content

change property names #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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