NanoBeacon / config-files

sample config for IN100
MIT License
14 stars 2 forks source link

BMA400 reading of axis data on tap - possible? #2

Closed sam-m-1234 closed 1 year ago

sam-m-1234 commented 1 year ago

Hi, I'm currently working on a project where I need to meet either one of the following use cases with the IN100 and BMA400 accelerometer: 1) read and advertise the accelerometer axis data on motion/tap events only 2) poll the accelerometer axis data periodically as per the existing example (i2c_bma400.cfg), but then only advertise the data when the motion/tap interrupt fires.

I was wondering if either of the above use case would be possible with the IN100? If there are any example .cfg files you have which demonstrate similar functionality it would be extremely helpful if you could share them!

Thanks

NanoBeacon commented 1 year ago

Hi sam-m-1234

The IN100 is able to advertise on a trigger event. For a sensor like the BMA400, this would be as simple as wiring the interrupt line to one of the IN100's GPIO's. The BMA400 tap example on the GitHub is meant to function like this. Test it out and see if the behavior is what you need. The axis data and other sensor data can be added to the payload with an I2C read command during warm bootup and adding 'I2C Slave #1 Read Data' to the IN100 payload. In short, use case 1 is easily doable by editing the tap example.

I hope the above explanation makes sense. If any difficulties arise, or you need more details, feel free to respond to this message, or email me separately at aidan.martens@inplay-tech.com

sam-m-1234 commented 1 year ago

Hi Aidan,

Thanks for your fast response. After reading your explanation, it makes much more sense now.

So just to clarify the i2c side of things, roughly speaking I should configure the BMA400 to generate interrupts using cold boot i2c commands as per 'i2c_tap_bma400.cfg', then successive warm boots (triggered by the interrupt) should just read the axis data as per 'i2c_bma400.cfg'?

Sorry for all the questions, just want to make sure my understanding is on track before I start flashing my boards.

Thanks

NanoBeacon commented 1 year ago

Hi sam-m-1234

Yes, in general you configure the sensor settings during cold boot. This would include generating the interrupt. You are also correct that on subsequent warm bootup events you would read from the registers.

Read the BMA 400 Datasheet register definitions for a clearer picture of how the device is meant to function. Cross-reference the datasheet with the examples on the GitHub to get a better understanding of what is being done and why. I would also recommend to look briefly at the other I2C examples for other sensors available on the GitHub.

sam-m-1234 commented 1 year ago

Great, thanks for clarifying that. I will definitely have a thorough read of the BMA400 datasheet and cross reference against the existing examples to make sure I fully understand everything going on with the i2c commands before going any further. I really appreciate your assistance.

Thanks

Saranya-karan commented 2 weeks ago

Great, thanks for clarifying that. I will definitely have a thorough read of the BMA400 datasheet and cross reference against the existing examples to make sure I fully understand everything going on with the i2c commands before going any further. I really appreciate your assistance.

Thanks

have u got the data by interfacing bma400 with beacon?