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

[feature] BMA421 integration #48

Open
sdorre opened this issue Jul 17, 2020 · 6 comments
Open

[feature] BMA421 integration #48

sdorre opened this issue Jul 17, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@sdorre
Copy link
Collaborator

sdorre commented Jul 17, 2020

The Pinetime has an accelerometer integrated. Let's try to get it to work.

The hardware is a Bosch BMA421.
One guy already has it working with Micro Python on the pinetime. He wrote the following code:
https://github.com/daniel-thompson/bma42x-upy

@sdorre sdorre added the enhancement New feature or request label Jul 17, 2020
@sdorre sdorre self-assigned this Jul 17, 2020
@endian-albin
Copy link
Collaborator

endian-albin commented Jul 17, 2020

As long as the implemention is all free software, then yeah!

sdorre added a commit that referenced this issue Jul 17, 2020
* Seems to work now
* Need to make sense of the values
* Need to test step counter
* implements #48

Signed-off-by: Stephane Dorre <stephane.dorre@gmail.com>
@sdorre
Copy link
Collaborator Author

sdorre commented Jul 17, 2020

I pushed a branch if you want to have a look at the alpha.
I did not get the chance to see other than 0 for the step counter so far.
I broke my debug setup. I will fix it on monday.

@endian-albin
Copy link
Collaborator

endian-albin commented Jul 24, 2020

This looks really promising! The step counter appears to be accurate from a very short test. I'm a bit suspicious about the thermometer though. I don't think it exists in the BMA421 component that's on the PineTime, see the flyer for example). Also, I went outside where it's more than 10 degrees colder right now and the temperature dropped just one degree.

@endian-albin
Copy link
Collaborator

Ah, so the thermometer is for the accelerometer chip itself... It shouldn't be used to measure the outside temperature.

sdorre added a commit that referenced this issue Jul 29, 2020
* Seems to work now
* Need to make sense of the values
* Need to test step counter
* implements #48

Signed-off-by: Stephane Dorre <stephane.dorre@gmail.com>
@sdorre
Copy link
Collaborator Author

sdorre commented Aug 11, 2020

I made some changes on my PR. It is now running on interrupt without the config blob.
So only acceleration data is accessible.

@endian-albin Do you want me to rewrite it so we get rid of the BSD-3 Code from Bosch ?

@endian-albin
Copy link
Collaborator

endian-albin commented Aug 11, 2020

I made some changes on my PR. It is now running on interrupt without the config blob.
So only acceleration data is accessible.

OK, can you think of a use case for this? Even if this is good for the future, I prefer to have at least some new feature that makes use of added code. Could we use it combined with a repeatable timer (80--100 ms) that checks the XYZ values for a position where a human might look at it and then light up the display ("lift to wake")?

@endian-albin Do you want me to rewrite it so we get rid of the BSD-3 Code from Bosch ?

If you think you can also make it smaller, better, etc and you do a proper rewrite like ATCWatch did. That might also make it easier to upstream. Otherwise, BSD-3-Claue is compatible with Apache 2.0 so you could also simply add a copyright line and Apache 2.0 SPDX line on top of the BSD-3 header text. Then you should also add a BSD-3-Clause SPDX line close to the Bosch copyright line, maybe just above it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants