Connecting I2C accelerometer to jetson nano

hello everyone, I am trying to connect an accelerometer (BMA220) (Fermion: BMA220 Digital Triaxial Acceleration Sensor (Breakout) - DFRobot) to my jetson nano so i can get the x,y,z data. I have connected it to bus 1 and get this output when running i2cdetect -y -r 1:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- 0a -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

My question is, what do I do next to get the data from the accelerometer? Is there a way to use python to handle the data? Thank you for any help.

hello aaronalvarez7394,

there’s driver for this BMA220 acceleration sensor driver,
$TOP/public_sources/r32.6.1/Linux_for_Tegra/source/public/kernel_src/kernel/kernel-4.9/drivers/iio/accel/bma220_spi.c

there’s API to fetch the data for your usage.
for example,

static const struct iio_info bma220_info = {
        ...
        .read_raw               = bma220_read_raw,

so, you may use the serial port utility to setup a loop to communicate with this sensor continuously.
I’ve google it around, and there’re some samples you may check for reference, bma220 sample code python - Google Search

Thank you for the helpful reply, i was wondering how do i implement the driver? I am new to jetson nano and linux in general, sorry. Thank you again

please google for some sample-code for reference, thanks

I will, i just wanted some clarity of what this line of code does? Please $TOP/public_sources/r32.6.1/Linux_for_Tegra/source/public/kernel_src/kernel/kernel-4.9/drivers/iio/accel/bma220_spi.c

please access Jetson Linux R32.7.2 Release Page | NVIDIA Developer and you may download [L4T Driver Package (BSP) Sources] for the public release sources,
then you’ll see the driver sources.

hello, i have downloaded it and unzipped it but i do not know what to do next.

please check my previous comments…

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.