-
Notifications
You must be signed in to change notification settings - Fork 3.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
changes regarding x, y, and z values in hmc5883l.c #2133
Conversation
in previous code of hmc5883l.c it uses x = (int16_t) ((data[0] << 8) | data[1]); y = (int16_t) ((data[2] << 8) | data[3]); z = (int16_t) ((data[4] << 8) | data[5]); but as per hmc5883l datasheet 2nd and 3rd bytes are of z axis i.e. it should be x = (int16_t) ((data[0] << 8) | data[1]); z = (int16_t) ((data[2] << 8) | data[3]); y = (int16_t) ((data[4] << 8) | data[5]);
@jschmidlapp contributed the code originally. Hence, he should be able to assess the validity of your changes. |
Sure, this change makes sense. |
This reverts commit 92b6bad.
Nope, you created it against |
uffff,...sorry I don't know how to do it. I just created account on GitHub first time to just notify this one. |
Done..!! Created against dev branch.. |
As per hmc5883l datasheet 2nd and 3rd bytes are of z axis rather than y.
This reverts commit 92b6bad.
As per hmc5883l datasheet 2nd and 3rd bytes are of z axis rather than y.
This reverts commit 92b6bad.
As per hmc5883l datasheet 2nd and 3rd bytes are of z axis rather than y.
This reverts commit 92b6bad.
in current code of hmc5883l.c it uses
x = (int16_t) ((data[0] << 8) | data[1]);
y = (int16_t) ((data[2] << 8) | data[3]);
z = (int16_t) ((data[4] << 8) | data[5]);
but as per hmc5883l datasheet
0th and 1st bytes are of x axis
2nd and 3rd bytes are of z axis
4th and 5th bytes are of y axis
i.e. it should be
x = (int16_t) ((data[0] << 8) | data[1]);
z = (int16_t) ((data[2] << 8) | data[3]);
y = (int16_t) ((data[4] << 8) | data[5]);
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.
dev
branch rather than formaster
.docs/en/*
.<Description of and rationale behind this PR>