I recently purchased an NXT Compass Sensor from Lego/HiTechnic. I'm trying to use it with NXT++ and Visual C++ 2010 Express, but the function "GetCmpsNxValue" is always returning either 0 or 1.
This returns a range from 0-359 (with 0 in a northern orientation) as I rotate the robot around, so I have some hope it is correct. Could you comment on whether this is reasonable?
In any case, thanks a bunch for the NXT++ project!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I recently purchased an NXT Compass Sensor from Lego/HiTechnic. I'm trying to use it with NXT++ and Visual C++ 2010 Express, but the function "GetCmpsNxValue" is always returning either 0 or 1.
After looking at the nxt++ code and the info about the registers and such at
http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NMC1034
I suspect that the value being returned by GetCmpsNxValue is simply the "one degree adder".
With that suspicion, I took a blind stab at fixing GetCmpsNxValue thus:
This returns a range from 0-359 (with 0 in a northern orientation) as I rotate the robot around, so I have some hope it is correct. Could you comment on whether this is reasonable?
In any case, thanks a bunch for the NXT++ project!