Skip to content

Commit 397bae5

Browse files
committed
Update example
1 parent 170c9a7 commit 397bae5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ Usage Example
5959
import time
6060
import board
6161
import busio
62-
import adafruit_fxas21002c
62+
import adafruit_fxos8700
6363
6464
i2c = busio.I2C(board.SCL, board.SDA)
65-
sensor = adafruit_fxas21002c.FXAS21002C(i2c)
65+
sensor = adafruit_fxos8700.FXOS8700(i2c)
6666
6767
while True:
68-
gyro_x, gyro_y, gyro_z = sensor.gyroscope
69-
print('Gyroscope (radians/s): ({0:0.3f}, {1:0.3f}, {2:0.3f})'.format(gyro_x, gyro_y, gyro_z))
68+
accel_x, accel_y, accel_z = sensor.accelerometer
69+
mag_x, mag_y, mag_z = sensor.magnetometer
70+
print('Acceleration (m/s^2): ({0:0.3f}, {1:0.3f}, {2:0.3f})'.format(accel_x, accel_y, accel_z))
71+
print('Magnetometer (uTesla): ({0:0.3f}, {1:0.3f}, {2:0.3f})'.format(mag_x, mag_y, mag_z))
7072
time.sleep(1.0)
7173
7274
Contributing

0 commit comments

Comments
 (0)