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

changes regarding x, y, and z values in hmc5883l.c #2133

Merged
merged 1 commit into from
Oct 15, 2017
Merged

changes regarding x, y, and z values in hmc5883l.c #2133

merged 1 commit into from
Oct 15, 2017

Conversation

Suraj151
Copy link
Contributor

@Suraj151 Suraj151 commented Oct 12, 2017

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
image

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.

  • 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/en/*.

<Description of and rationale behind this PR>

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]);
@Suraj151 Suraj151 changed the title changes regarding x, y, and z values changes regarding x, y, and z values in hmc5883l.c Oct 12, 2017
@marcelstoer
Copy link
Member

@jschmidlapp contributed the code originally. Hence, he should be able to assess the validity of your changes.

@jschmidlapp
Copy link
Contributor

Sure, this change makes sense.

@marcelstoer marcelstoer added this to the 2.1 follow-up II milestone Oct 15, 2017
@marcelstoer marcelstoer merged commit 92b6bad into nodemcu:master Oct 15, 2017
marcelstoer added a commit that referenced this pull request Oct 15, 2017
marcelstoer added a commit that referenced this pull request Oct 15, 2017
@marcelstoer
Copy link
Member

[x] This PR is for the dev branch rather than for master

Nope, you created it against master - and I didn't notice 😞. Hence, I had to revert the changes. Please create a new PR.

@Suraj151
Copy link
Contributor Author

Suraj151 commented Oct 16, 2017

uffff,...sorry I don't know how to do it. I just created account on GitHub first time to just notify this one.
ok no matter. from this I understand that PR need to be create against dev branch right..!!
I will try to do it right now....!!

@Suraj151
Copy link
Contributor Author

Done..!! Created against dev branch..

@marcelstoer marcelstoer removed this from the 2.1 follow-up II milestone Oct 16, 2017
eiselekd pushed a commit to eiselekd/nodemcu-firmware that referenced this pull request Jan 7, 2018
As per hmc5883l datasheet 2nd and 3rd bytes are of z axis rather than y.
eiselekd pushed a commit to eiselekd/nodemcu-firmware that referenced this pull request Jan 7, 2018
vsky279 pushed a commit to vsky279/nodemcu-firmware that referenced this pull request Sep 8, 2018
As per hmc5883l datasheet 2nd and 3rd bytes are of z axis rather than y.
vsky279 pushed a commit to vsky279/nodemcu-firmware that referenced this pull request Sep 8, 2018
nagarsumit pushed a commit to nagarsumit/nodemcu-firmware that referenced this pull request Nov 5, 2018
As per hmc5883l datasheet 2nd and 3rd bytes are of z axis rather than y.
nagarsumit pushed a commit to nagarsumit/nodemcu-firmware that referenced this pull request Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants