头像-118667

堕落~到~人间

  • 单片机 嵌入式 模拟技术

个人成就

获得 0 次赞

帮助过1人

galileo板子怎么获取GPS模块数据--再发个悬赏

输出到文件里是这样的,还有初始化写入配置啊

galileo板子怎么获取GPS模块数据--再发个悬赏

int open_port(char *port_device,FILE *write_fp) {     int fd;      fd = open(port_device, O_RDWR);     if (fd == -1)     {       fprintf(write_fp,"open_port: Unable to open %d ",fd);     }     return (fd); } int main(){   struct termios options;   char buf[1024];   FILE *write_fp;   write_fp = fopen("gpsInfo11.txt","w");   int fd=open_port("/dev/1-1",write_fp);   fprintf(write_fp,"fd===%d ",fd);   if(fd==-1){   close(fd);   return -1;    }   tcgetattr(fd,&options);   cfsetispeed(&options, B9600);   cfsetospeed(&options, B9600);    ssize_t nread; while(1){     nread =read(fd, buf, sizeof(buf));     fprintf(write_fp,"n==%d ",nread);     fprintf(write_fp,"buf==%s ",buf);     delay(500); } fclose(write_fp); close(fd); return 0; }

galileo板子怎么获取GPS模块数据--再发个悬赏

是接里么,但我接上去模块灯都不亮

galileo板子怎么获取GPS模块数据--再发个悬赏

GPS模块是ublox neo-6m,第一个就是1-1,被字遮住了: