Go to Post I like this thread because it means I don't have to leave my house to find something to complain about! - PayneTrain [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2009, 10:16
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
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();
The CompassAngle readings are always 65535.0. We checked the cable continuity from the I2C connector on the sidecar to the compass module and it seems ok. See anything wrong?
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2009, 12:24
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
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?
__________________
Eric Haskins KC9JVH
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2009, 17:39
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
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);
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2009, 22:44
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compass tilt error knine143 Sensors 2 29-05-2008 07:58
Gyro Compass Nathan Programming 5 16-01-2008 14:55
I2C Digital Compass Programming CyberWolf_22 Programming 7 03-01-2005 00:20
Political Compass Joshua May Chit-Chat 11 01-10-2004 22:32
Compass/direction sensor Frank(Aflak) Technical Discussion 10 06-04-2003 09:18


All times are GMT -5. The time now is 14:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi