should not it be buf[1] instead of buf[0] as the status bit in the status register is 15th bit?Zili wrote: ↑Thu Feb 01, 2018 1:52 pmcareful guys,
the while on the waiting loop is wrong.
try this way:
Code: Select all
do { if (read(fd, buf, 2) != 2) { perror("Read conversion"); exit(-1); } } while (!(buf[0] & 0x80));