The compass of my milestone2 is sometimes +-45° wrong
When I start a other Compass that can calibrate it'S ok.
But is there a Way to calibrate the compass with b4a?
in Java it looks like this
Gruss Björn
When I start a other Compass that can calibrate it'S ok.
But is there a Way to calibrate the compass with b4a?
in Java it looks like this
import icommand.nxt.comm.NXTProtocol;
public class CompassSensor extends I2CSensor {
private final static byte BEGIN_CALIBRATION = 0x43;
private final static byte END_CALIBRATION = 0x44;
private final static byte COMMAND = 0x41;
/**
* Begins calibrating the compass sensor resulting in more accurate measurements. Rotate compass
* at least two times, taking at least 20 seconds per rotation. Issue stopCalibration() when done.
* NOTE: Once the compass is calibrated, you do not have to recalibrate even when the NXT is
* turned off. The calibration settings are stored in internal non-volatile memory on the NXT.
*
*/
public void startCalibration() {
super.sendData(COMMAND, BEGIN_CALIBRATION);
}
public void stopCalibration() {
super.sendData(COMMAND, END_CALIBRATION);
}
Gruss Björn