pinetime-hypnos
pinetime-hypnos copied to clipboard
[feature] BMA421 integration
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
As long as the implemention is all free software, then yeah!
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.
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.
Ah, so the thermometer is for the accelerometer chip itself... It shouldn't be used to measure the outside temperature.
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 ?
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.