I'm using the mindsensor compass on my nxt.
Here's a small program I used to test my compass
It takes the compass readings every one seconds and output to the command line.
However, it seems that the compass reading remains the same even I turn the robot around. And there are some errors in between.
Compass cp = new Compass(SENSOR.S2);
for (int i=0; i<20; i++){
System.out.println("("+i+")Degree = " + cp.getDegrees());
Thread.sleep(1000);
}
The output:
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
(0)Degree = 2.2
(1)Degree = 2.2
NXTCommand.LSGetStatus() error: Pending communication transaction in progress
(2)Degree = 2.2
(3)Degree = 2.2
(4)Degree = 2.2
Is there anything I've missed or written wrong?

