This is a demo to show how to get the data of BMI160 by SPI ioctl in ROScube Pico.
The data includes:
- CHIP ID
- PMU STATUS
- SENSOR DATA (ACCEL and GYRO).
The model supported by BMI160 is only the ROScube Pico series.
In this BMI160 demo, by using /dev/spidev2.0
.
Download the code.
git clone https://github.com/Adlink-ROS/bmi160_spi_demo.git
cd bmi160_spi_demo
Test the demo following the command.
gcc -o bmi160_test main.c bmi160.c
./bmi160_test
If successfully worked, it will show data:
- CHIP ID:
0xD1
- PMU STATUS:
0x14
- SENSOR DATA: 50 points
It will show OK message on the first line, that means bmi160_perform_self_test
was successful.
When occurred filed or error, please check the Error Value from bmi160.h.