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

Is your code too big? #9

Open
nsmith1024 opened this issue Dec 27, 2021 · 2 comments
Open

Is your code too big? #9

nsmith1024 opened this issue Dec 27, 2021 · 2 comments

Comments

@nsmith1024
Copy link

I was thinking of using your code, but it seems your code plus the 20948 library plus my code is too big for the arduino.

All i need is to be able to read the values as a quaternion, do i need all your code to do that?

@ZaneL
Copy link
Owner

ZaneL commented Dec 27, 2021

Yeah, I've only tested this library on Arduino platforms with a large amount of flash and RAM - such as a Teensy.

If I were you I'd first try this library that uses the internal DMP hardware: https://github.com/sparkfun/SparkFun_ICM-20948_ArduinoLibrary

If that's still too large, you're gonna have to get the raw accelerometer, mag, and gyro values using a library like that one. But rather than using the DMP to get the quaternion, you'll need to do it using a madgwick algorithm.

https://github.com/arduino-libraries/MadgwickAHRS

The code size should be smaller, but it will require the CPU on your Arduino to do much more work.

@ZaneL
Copy link
Owner

ZaneL commented Dec 27, 2021

https://github.com/arduino-libraries/MadgwickAHRS/blob/master/src/MadgwickAHRS.h

void update(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz);

For example you can see here what you need to do. Get the raw accelerometer, gyro and mag values and feed them into that update function. Then you can get the roll, pitch and yaw.

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

No branches or pull requests

2 participants