I'm trying to write a single byte to an Arduino via serial. The "command" is a singe char sent from another method. The 's' correctly transfers to 115 when I view byteCommand[0]
but when I view byteCommand
as a whole it will show up as a string staring with [B@
and then a bunch of hex characters. I could modify the Arduino code to look for that rather than the char value, but I feel like the byte can be sent through properly.
byte[] byteCommand = new byte[1];
byteCommand[0] = (byte) command[0]
if (command == 's' || command == 'f') {
mSerialPort.write(byteCommand);
commandInfo.setText(String.valueOf(command));
rawInfo.setText(String.valueOf(byteCommand));
}