# Trouble With libiio & bmi160

**URL:** <https://mangoh.discourse.group/t/trouble-with-libiio-bmi160/2098>\
**Category:** mangOH Red\
**Created:** [November 13, 2018, 2:35am UTC](https://mangoh.discourse.group/t/trouble-with-libiio-bmi160/2098 "2018-11-13T02:35:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonprevost](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dragonprevost](https://mangoh.discourse.group/u/dragonprevost)\
**Post date:** [November 13, 2018, 2:35am UTC](https://mangoh.discourse.group/t/trouble-with-libiio-bmi160/2098/1 "2018-11-13T02:35:51Z")

</div>

Hello all,

I am in the process of integrating libiio into a Mangoh Red WP85 project using the bmi160\_fifo branch from the MangOH repository found [here](https://github.com/mangOH/mangOH/tree/bmi160_fifo). My goal is to read three channels from the accelerometer. I have been following the BufferedImuRead sample provided [here](https://github.com/mangOH/mangOH/blob/bmi160_fifo/samples/BufferedImuRead/bufferedImuReadComponent/main.c) .

After calling `iio_buffer_foreach_sample(sampleBuffer, ImuSampleCallback, NULL);` The callback appears to run for the angular velocity channels but not the Accelerometer channels.

I have disabled the Gyro channels using `iio_channel_disable(gyroXChan);` and placed a logging function inside the callback function (`LE_INFO("Running Callback for %s", iio_channel_get_id(chan));`) Resulting in an output of,  
 ![23%20AM](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/1X/753649ab4e95194e1dd5ffce50fd3e3d5bee733e.png)

This has been confusing me since I am under the impression that disabled channels `would not` be passed into the call back function and that enabled channels `would` be passed into the callback. Having this said I am very new to libiio and would appreciate any insight.

Thanks in advance for any support!
