dCompass Compass from Dexter Industries

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

dCompass Compass from Dexter Industries

Postby ThinkOnTheEdge » Fri Nov 01, 2013 7:50 pm

I have a dCompass from Dexter Industries and I am having trouble making it work. Is there a class built into Lejos for this?

I found this driver HMC5883L.java, but it has two import lines for items from an unknown package tree:
Code: Select all
import nl.totan.sensors.MagnetoData.AngleUnits;
import nl.totan.sensors.MagnetoData.MagnetoUnits;

Which appear to then be used like this:
Code: Select all
protected MagnetoUnits         magnetoUnit               = MagnetoUnits.milliGauss;
protected AngleUnits            angleUnit                  = AngleUnits.Radians;

and I am too much of a Java noobie to understand what this all means well enough to fix it.
ThinkOnTheEdge
New User
 
Posts: 2
Joined: Fri Nov 01, 2013 7:29 pm

Re: dCompass Compass from Dexter Industries

Postby kirkpthompson » Sat Nov 02, 2013 2:32 pm

The package name looks like Aswin's. Maybe try to contact him.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: dCompass Compass from Dexter Industries

Postby Aswin » Sun Nov 03, 2013 12:52 pm

Hi,

This points to two enums that should be foud in the same package as the compass class. But I'll create a new class for you that does not use these enums. Check back later.

Aswin
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 188
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: dCompass Compass from Dexter Industries

Postby ThinkOnTheEdge » Mon Nov 04, 2013 11:32 pm

I made it work, or at least run and give me interesting numbers from the dCompass that I assume are correct. :)

Eclipse suggested that I import the class itself to correct for the missing enums.
I feel like this is something wrong, but I'm learning Java so I accept that the IDE is smarter than me at this point.

Anyway, I found the enum definitions at the bottom of the file, and indeed, if I import the file itself like this:

Code: Select all
import com.mytestproject.HMC5883L.Samples.AngleUnits;
import com.mytestproject.HMC5883L.Samples.MagnetoUnits;


it works compiles, runs and gives me output from the dCompass on the NXT.

FYI, I am using the HMC5883L.java file that I downloaded from this link on Dexter Industries web site:
http://www.dexterindustries.com/files/dCompass_Java.zip

Aswin, thank you very much for looking into this! If you have a better driver, I would be very glad to use it, and even suggest to Dexter that they put it on their site.
I noticed that on your blog here http://nxttime.wordpress.com/2011/11/22 ... -software/ there is a comment from "Noora" in March having the exact same problem as I was.
My guess is that either the dCompass is not commonly used with LeJOS or perhaps most users who buy it are experienced enough with Java to find the solution instantly.

Incidentally, I bought the dCompass because it is available for less than half the price of the HiTechnic NXT compass!
ThinkOnTheEdge
New User
 
Posts: 2
Joined: Fri Nov 01, 2013 7:29 pm

Re: dCompass Compass from Dexter Industries

Postby Aswin » Tue Nov 05, 2013 6:21 am

Hi,

Glad that you got the driver working. The driver is fine, although I was told that the enums use too much memory space.

The compass itself is good. It is the only compass for the NXT that can be tilt compensated. Although you have to use other sensors and write your ow code to do so.
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 188
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff