|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
HiTechnic compass - reading 65535?
Is this how to use the HiTechnic compass?
Code:
HiTechnicCompass *m_compass; float CompassAngle; .... m_compass = new HiTechnicCompass(4); // slot 4 .... CompassAngle = m_compass->GetAngle(); |
|
#2
|
||||
|
||||
|
Re: HiTechnic compass - reading 65535?
That looks correct. I looked at some of my compass test code, and I didn't have to do anything else. I wrote my compass code pre-season and I was using an older version of WPILib, so it may have changed since then.
Do you have another compass and cable to test with? Did you try your other DSC? |
|
#3
|
||||
|
||||
|
Re: HiTechnic compass - reading 65535?
do you know because of a printf?
we had a wierd output and it was because it was printf("%i\n", floatvalue); when it should have been printf("%f\n", floatvalue); |
|
#4
|
|||
|
|||
|
Re: HiTechnic compass - reading 65535?
Thanks for the replies. We replaced the cable with another and the problem went away, so it was a bad cable. The code does work and the compass is working well.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compass tilt error | knine143 | Sensors | 2 | 05-29-2008 07:58 AM |
| Gyro Compass | Nathan | Programming | 5 | 01-16-2008 02:55 PM |
| I2C Digital Compass Programming | CyberWolf_22 | Programming | 7 | 01-03-2005 12:20 AM |
| Political Compass | Joshua May | Chit-Chat | 11 | 10-01-2004 10:32 PM |
| Compass/direction sensor | Frank(Aflak) | Technical Discussion | 10 | 04-06-2003 09:18 AM |