when I connect two bricks via RS485 with one running the "NXTLCPRespond" program from the samples dir and the other running this:
- Code: Select all
import java.io.IOException;
import lejos.nxt.LCD;
import lejos.nxt.TouchSensor;
import lejos.nxt.comm.RS485;
import lejos.nxt.remote.RemoteNXT;
public class ResetTachoCntBug {
public static void main(String[] args) throws IOException{
RemoteNXT rnxt = new RemoteNXT("NXT", RS485.getConnector());
TouchSensor cwLimit = new TouchSensor(rnxt.S2);
rnxt.B.forward();
while(!cwLimit.isPressed()){
try {Thread.sleep(50);} catch (InterruptedException e) {}
}
rnxt.B.stop(false);
try {Thread.sleep(3000);} catch (InterruptedException e) {}
LCD.drawString("resetting count", 0, 1);
rnxt.B.resetTachoCount(); // that's when it happens
try {Thread.sleep(1000);} catch (InterruptedException e) {}
LCD.drawString("done", 0, 2);
try {Thread.sleep(10000);} catch (InterruptedException e) {}
}
}
then rnxt.B.resetTachoCount() will actually rotate the motor back to 0, instead of just resetting the count.
That's not what it is supposed to do, right?
c.
