From: Demetris Z. <fgc...@cy...> - 2007-12-07 23:11:21
|
I want to ask about C and Serial communication I have my PIC sending out in Ascii "Volt" and then in Ascii a number "123" so it's ("Volt","123") now i want to read that from C on linux, so the code is: char ch[100]; char *mychar = "V"; while(!volt_confirm) { Read(fd, & ch,1); If (*mychar == ch[0]) { Printf("Voltage: %s\n",ch); Volt_confirm = 1; } } But that gives me "V Some Garbage" How could I correctly wait for the pic to send the "Volt" characters and then read out the Numbers that follow? Please help me out here. |