Skip to content
Snippets Groups Projects
Commit 1f10daad authored by fortissBot's avatar fortissBot
Browse files

refs 7956
parent a65049b6
No related branches found
No related tags found
No related merge requests found
......@@ -3,14 +3,11 @@
/** Initialize the laser range finder. */
void lrf_init() {
//char port[] = "/dev/????????";
char port[100];
char port[] = "/dev/????????";
//FILE* fp = popen("dmesg | grep -A 3 \"Arduino Uno\" | grep -o \"ttyACM.\" | tail -n 1","r");
FILE* fp = popen("ls -d /dev/serial/by-id/* | grep \"Arduino\" | tr -d \"\n\"", "r");
//fgets(port+5, sizeof(port)-6, fp);
fgets(port, sizeof(port), fp);
printf("lrf port=%s\n", port);
FILE* fp = popen("dmesg | grep -A 3 \"Arduino Uno\" | grep -o \"ttyACM.\" | tail -n 1","r");
fgets(port+5, sizeof(port)-6, fp);
printf("Port: %s\n", port);
pclose(fp);
uart_setup(port);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment