Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to convert the measurement range of MPU6050 accelerometer and the gyroscope?

Status
Not open for further replies.

ckkkkk

Junior Member level 2
Joined
Apr 19, 2019
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
204
HTML:
import smbus
import time

# Get I2C bus
bus = smbus.SMBus(1)

# MPU-6000 address, 0x68(104)
# Select gyroscope configuration register, 0x1B(27)
# 0x18(24) Full scale range = 2000 dps
bus.write_byte_data(0x68, 0x1B, 0x18)
# MPU-6000 address, 0x68(104)
# Select accelerometer configuration register, 0x1C(28)
# 0x18(24) Full scale range = +/-16g
bus.write_byte_data(0x68, 0x1C, 0x18)

# MPU-6000 address, 0x68(104)
# Select power management register1, 0x6B(107)
# 0x01(01) PLL with xGyro reference
bus.write_byte_data(0x68, 0x6B, 0x0

Its in +-16g but and according to the datasheet https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf page 15, its AFS_SEL. So i just simply replace the '0x18' into AFS_SEL = 0 and replace '0x18' into FS_SEL = 0 for both accelerometer and gyro?
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top