-3

My code worked fine when I was just sending 1 letter or 1 number, but now I tried editing it to make it send two values and a ":" as well, but for some reason it doesn't work. Here is the code I am using:

@Override
  public void onMove(int angle, int strength) {
    mTextViewAngleLeft.setText(angle + "°");
    mTextViewStrengthLeft.setText(strength + "%");
    command = (angle + ":" + strength + "\n");
    try {
      outputStream.write(command.getBytes()); //transmits the value of command to the bluetooth module
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

Command is declared as String.

dda
  • 6,030
  • 2
  • 25
  • 34
beel
  • 15
  • 6

2 Answers2

0

This is a hunch, but the degree symbol may be causing the problem, try using the Unicode value. Help with Unicode Value here

Lew Perren
  • 1,209
  • 1
  • 10
  • 14
0

Turn out it was a hardware error (the Bluetooth was not working correctly)

beel
  • 15
  • 6