I wrote a serial communication program in MATLAB and now want to translate it in Java. I have translated the rest of the code but failed with this part:
fprintf(s,'C');
x = fgets(s);
where x is the response I would like to get from a serial device and
s is my serial object
I would really appreciate any help.
Thanks
You need to use a Scanner on your input stream, for example: