Menu

#1 cannot write/read to the device

open
nobody
None
5
2009-07-30
2009-07-30
hen
No

Hi I got a problem writing/reading to/from a device, I'm not sure, but when I write a command to the device I cannot nothing but 0s when I read from the device, this is the code I'm using:

// String t = "T";
// device.write(t.getBytes());
// byte[] respuesta = new byte[7];
// int r = device.read(respuesta);
// String result = "0";
// if (r != 0){
// for (int i=0; i<respuesta.length; i++)
// result = result + " " + (respuesta[i]);
// }
// System.out.println(result);

I'm not sure if I'm doing somthing wrong bu I got it to work before but I can't now. Can anyone help? I'm using a device with the FT232R chip.

Thanks in advance.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB