-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Constant Values with MPU6050 on Raspberry Pi #236
Comments
Hi, @ryanskidmore I was just looking at our implementation for MPU6050 in Cylon.js and I see a couple of differences. One in particular being https://github.com/hybridgroup/cylon-i2c/blob/master/lib/mpu6050.js#L113 I will try to find my MPU6050 and play around with this, but if you have a chance to write a little code to send the "wake up" that looks to be worth trying. |
@deadprogram When I first looked at the driver I initially thought the wakeup instruction was handled by https://github.com/hybridgroup/gobot/blob/dev/platforms/i2c/mpu6050_driver.go#L104, but now that i've looked at it again I can't see any wake up instruction. Just noticed this line though https://github.com/hybridgroup/gobot/blob/dev/platforms/i2c/mpu6050_driver.go#L128 - not entirely sure what this does "setSleepEnabled" gives the impression it's putting it back into sleep mode. I know that a 0x00 needs to be sent to the PWR_MGMT_1 Register, so I'm guessing that's what's going wrong. I'll try and work on a fix next week sometime. |
I've had a chance to modify the gobot code but no luck - I removed the set sleep enabled part and send the wake up byte to pwr_mgmt_1 but still getting constant values. |
I will play with this when I'm back in the lab later this week. Thanks for reporting. |
i think you have the same problem like me before. I think this will help you: open the file mpu6050_driver.go and change: const MPU6050_PWR1_SLEEP_BIT = 6 to const MPU6050_PWR1_SLEEP_BIT = 0 |
I've got my MPU6050 connected via I2C to my Raspberry Pi (WHOAMI returns correct address) but I seem to be getting constant values, despite moving the sensor (quite a lot!).
I've attached a stripped down version of my code below in hopes that it's just an issue with my code, rather than deeper in the Gobot library.
If it isn't a code issue on my end, could there potentially be an issue with the way Gobot configures the MPU6050?
The text was updated successfully, but these errors were encountered: