Skip to content
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

[wip] add mpu6050 sensor #2769

Closed
wants to merge 4 commits into from
Closed

[wip] add mpu6050 sensor #2769

wants to merge 4 commits into from

Conversation

feilongfl
Copy link

Fixes #<GitHub-issue-number>.

Make sure all boxes are checked (add x inside the brackets) when you submit your contribution, remove this sentence before doing so.

  • This PR is for the dev branch rather than for master.
  • This PR is compliant with the other contributing guidelines as well (if not, please describe why).
  • I have thoroughly tested my contribution.
  • The code changes are reflected in the documentation at docs/*.

<Description of and rationale behind this PR>

@nwf
Copy link
Member

nwf commented May 26, 2019

Given that this module appears to be only I2C and needs no sophisticated timing handling &c, it may be better off as a Lua module than a C one.

@feilongfl
Copy link
Author

@nwf
This sensor requires very frequent read and write operations, and requires a lot of calculations when parsing data(todo). I think that making a c language module will have better performance.

@HHHartmann
Copy link
Member

HHHartmann commented May 28, 2019

Just for reference: there was also #2548

@feilongfl feilongfl changed the title add mpu6050 sensor [wip] add mpu6050 sensor Jun 1, 2019
@devsaurus
Copy link
Member

Build fails now since #2838 was merged:

CC app/modules/mpu6050.c
mpu6050.c:10:22: fatal error: c_stdlib.h: No such file or directory
 #include "c_stdlib.h"
                      ^
compilation terminated.

You need to rebase onto current dev and adapt.

@vsky279
Copy link
Contributor

vsky279 commented Feb 14, 2021

I've missed this PR. I have a Lua version of the MPU9250 driver - see vsky279@232f61d
MPU9250 is actually MPU6050 + AK8975 magnetometer + BMP280.

But I could not make it work reasonably so I dit not file any PR. It was not working even on Arduino with existing libraries.

@feilongfl if you can try this Lua driver?

You are right that there are quite complex calculations to be performed. Maybe C library just handling complex calculations would be the right way to implement this. I wanted to do it in a second step. But I froze on the first step :-).

We've taken similar approach for the new BME280 driver (https://nodemcu.readthedocs.io/en/dev/lua-modules/bme280/) where calculations are in the C module bme280_math (https://nodemcu.readthedocs.io/en/dev/modules/bme280_math/).

@feilongfl feilongfl closed this Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants