> -----Original Message----- > From: Michael Welling [mailto:mwelling79@xxxxxxxxx] On Behalf > Of Michael Welling > Sent: Wednesday, August 19, 2015 2:29 PM > To: Greg Wilson-Lindberg > Cc: Daniel Baluta; linux-iio@xxxxxxxxxxxxxxx > Subject: Re: BBB IIO ADC access not working > > On Wed, Aug 19, 2015 at 02:13:10PM -0700, Greg Wilson-Lindberg wrote: > > > > I'm not using > /sys/bus/iio/devices/iio:device0/in_voltageX_raw in my > > program, I'm using the iio buffer system. > > > > I tried using cat /sys/bus/iio/devices/iio:device0/in_voltageX_raw > > while my program was running and it worked a couple of > times, and got > > busy a bit also, then the touch screen locked up. > > This is expected because when the buffer is enabled the > device IS busy. > > > > I have not tried to use > > /sys/bus/iio/devices/iio:device0/in_voltageX_raw from in my > program, I > > was hoping for a lighter weight access that didn't require so many > > opens & closes. I'm under the impression that I can only > get one reading per open if I try to read > /sys/bus/iio/devices/iio:device0/in_voltageX_raw. > > Or can I get multiple readings if I do multiple reads. > > > > You should be able to keep the file descriptor open and > perform multiple reads. > > It is necessary lseek before reading from the same channel again. > > lseek(fd, 0, SEEK_SET); > > You will need a separate file descriptor for each channel. > So, in that case, can I just open it once and leave it open? Is it reading from a buffer, or is it reading what is current in the ADC? Can I just set up a timer to get readings to average then? -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html