ok,that works. the +1000 is not for testing.
i have change both arduino and lite-c as u said and it works.
thank u ,Evilsob
last night,before getting ur reply,i tried this in lite-c:
byte last_recieved[2] = {0,0};
if(port_read_bytes(hPort, last_recieved, 2)){
str_cpy((debug.pstring)[0]," ");
str_for_asc((debug.pstring)[0],(long)last_recieved[0]);
str_for_asc(inNumber,(long)last_recieved[1]);
str_cat((debug.pstring)[0],inNumber);
debugDr=str_to_num((debug.pstring)[0]);
}
it works too.
but i still don't understand the difference.
how to use port_read_number()? i found that u always use port_read_bytes().
it seems port_read_string() don't clear the Read-buffer,but port_read_bytes() did clear the buffer. am i mis-understanding?
is 4 byte integer means 4 byte binary data?