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
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!