I have a problem with the less than operator.
Source:
Ultrasonicsensor senor = new Ultrasonicsensor(SensorPort.S4);
int number = 500, currentDistance = 1;
boolean continueLoop = true;
do
{
currentDistance = sensor.getDistance;
continueLoop = currentDistance < number;
}
while (continueLoop);
Sound.beep();
So you should hear a sound, if currentDistance is greater than 500.
But the loop just continues. I tried other posisbilities with if-then and also ? :.
But it just doesn't work. I think it is probably a problem with the less than operator.
Do you have this problem too? Do you know how to solve it?
Marco
P.S. I'm german. So my English isn't perfect.
