I need to read adc value on user application.
actually, it's successful to read adc value in case of oneshot mode.
i used "open and read function" like this.
int main()
{
int fd;
char data[4];
fd = open("/sys/bus/iio/devices/iio\:device0/in_voltage5_raw", O_RDONLY);
read(fd, data, sizeof(data);
printf("%s\n", data);
}
it's same to "cat /sys/bus/iio/devices/iio\:device0/in_voltage5_raw"
but it's about oneshot mode.
i need to do in continuous mode.
i don't know how to do.
http://processors.wiki.ti.com/index.php/AM335x_ADC_Driver's_Guide
i saw this link and followed command.
echo continuous > /sys/bus/iio/devices/iio\:device0/mode
echo 1 > /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage5_en
echo 100 > /sys/bus/iio/devices/iio\:device0/buffer/length
echo 1 > /sys/bus/iio/devices/iio\:device0/buffer/enable
but there is no way how to read adc value in case of continuous mode.
when i tried cat /sys/bus/iio/devices/iio\:device0/in_voltage5_raw, it shows error message.
could anyone help me how to read adc value??:(
i wil be waiting for answer! thanks