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

Questions about file ADXL345.c #1

Open
RicksonMonteiroML opened this issue Feb 16, 2025 · 1 comment
Open

Questions about file ADXL345.c #1

RicksonMonteiroML opened this issue Feb 16, 2025 · 1 comment

Comments

@RicksonMonteiroML
Copy link

Hello, Truh! I hope you're doing well.

I am studying your project to design an electronic component, and I have some questions regarding the ADXL345 file.

Why do you multiply the rawValue by 4 in the __convertRawToDecimal method and return it as a int32_t data type? Is there a specific reason for that? I understand that the Tiva C series TM4C123GH6PM stores its values in two 8-bit registers, so it is necessary to read each one separately and store them in a int16_t variable. Wouldn't it be enough to use a variable of that data type?
I’m encountering some issues when I position my sensor at 90º. Sometimes, I receive full-scale values. Have you experienced this problem?

Congratulations on your project! It's been really helpful!

@truh
Copy link
Owner

truh commented Feb 19, 2025

Nice to hear you found my homework useful.

I imagine that I multiplied the value by 4 because that got me close enough to the resting position reading as 1G or something. The ADXL345 has adjustable precision, maybe that plays a role as well.

Unfortunately I no longer have the hardware to try it out.

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