Mindsensors compass problem

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

Mindsensors compass problem

Postby sunfire360 » Wed Mar 07, 2007 6:58 am

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?
sunfire360
New User
 
Posts: 1
Joined: Wed Mar 07, 2007 6:53 am

Re: Mindsensors compass problem

Postby biozik » Thu Jul 19, 2007 3:24 pm

Maybe it is :

CompassSensor cp = new CompassSensor(SensorPort.S2);

instead of Compass cp = new Compass(SENSOR.S2);

I'm not sure, I am a beginner with leJOS and I have never used I2C sensors... so it is just an idea ;)
biozik
New User
 
Posts: 7
Joined: Wed Jul 11, 2007 8:52 am

Postby bbagnall » Thu Jul 19, 2007 5:29 pm

Hi Sunfire. It sounds like you are using iCommand? The version out there right now is very old and outdated. I'll try to have the new updated release out within a week.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Re: Mindsensors compass problem

Postby cbadenh » Thu Oct 25, 2007 6:50 pm

sunfire360 wrote: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.
...

Is there anything I've missed or written wrong?


We have found that the HiTechnic compass sensor readings become mangled if the compass is too close to the lego NXT brick due to EM interference. Perhaps the same is true for the Mindsensor compass? When we moved the compass around 5 inches away from brick, the readings improved. I'm not sure if the motors are magnetically shielded either so you may want to keep the compass away from those guys too.
cbadenh
New User
 
Posts: 3
Joined: Thu Oct 18, 2007 3:37 pm


Return to NXJ Software

Who is online

Users browsing this forum: gloomyandy and 6 guests

cron
more stuff