什么系统下的adc?
我去测试一下~
下午回复你吧~
adc.c文件,更新如下~#include "stdio.h"
#include "sys/types.h"
#include "sys/ioctl.h"
#include "stdlib.h"
#include "termios.h"
#include "sys/stat.h"
#include "fcntl.h"
#include "sys/time.h"
int main(int argc, char **argv)
{
int fd,ret,adcdat0;
char buf;
fd=open("/dev/adc_dev",0);
if(fd<0)
{
printf("open adc error\n");
exit(1);
}
else
{
printf("success\n");
while(1)
{
read(fd,buf,2);
adcdat0=buf;
adcdat0=adcdat0<<8||buf;
printf("%x \n",adcdat0);
sleep(1);
}
}
close(fd);
}