AnsweredAssumed Answered

IIO Buffers

Question asked by ajaykuruba143@gmail.com on May 19, 2017
Latest reply on May 24, 2017 by larsc

hI

 

I  am using ADIS16485 IMU with iio.py using buffers and when i run this code i am getting junk data

 

 

#!/usr/bin/env python

# Program to log and print the IMU data on screen
# Author: Vishal Raveendranathan <vishal.r@teamindus.in>

import iio
import sys

# To print the IIO library version
print('IIO Library version: %u.%u (git tag: %s)' % iio.version)

contexts = iio.scan_contexts()
uri = next(iter(contexts),None)
iio.LocalContext()
ctx = iio.Context()


print('IIO context created: ' + ctx.name)
print('Backend version: %u.%u (git tag: %s)' % ctx.version)
print('Backend discription string: ' + ctx.description)
print('============================')
print('IIO contet has %u devices:' % len(ctx.devices))

adis16485_dev = ctx.find_device(b'adis16485')


if adis16485_dev:
print('Choosing ADIS16485 as the IIO device for all actions below...')
else:
print('No ADIS16485 found. Please check your connections again...!')
exit()

# To enable all the channels of ADIS16485
for i in range(0,len(adis16485_dev.channels)):
print('Enabling ' + str(adis16485_dev.channels[i].id) + ' ...')
adis16485_dev.channels[i].enabled = True
print('Scanelements = ' + str(adis16485_dev.channels[i]._scan_element))

my_buffer = iio.Buffer(adis16485_dev,500)
print 'Buffer obj length' + str(my_buffer._length)
my_buffer.refill()
values = my_buffer.read()
print(str(values))

 

 

and out put i am getting as

Outcomes