I am trying to remotely control one NXT from another one. For this reason, I would like to periodically check if the connection still exists. That is why I am using the code down there:
- Code: Select all
try {
String blueadd = remo.getBluetoothAddress();
LCD.drawString(blueadd,0,2);
if (blueadd == remo.getBluetoothAddress()) LCD.drawString("CORRECT!", 0, 4);
else LCD.drawString("WRONG!", 0, 4);
Delay.msDelay(3000);
} catch (Exception e) {LCD.drawString("ReadingException",0,7);Delay.msDelay(3000);System.exit(1);}
The hallarious thing is, that even though I just said blueadd = the bluetooth address, it keeps saying that its WRONG (I have to check that because I use it in another part of the program).
So what can I do? Does the string cut off some parts of the address, or what doesn't work? PS: It is the same with getName().
