Go to Post OK, I may have heavily influenced their decision, but I would never kill a mentor for not choosing an event I was planning... maim maybe, but never kill! :D - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-02-2008, 17:21
1594code 1594code is offline
Registered User
FRC #1594
 
Join Date: Feb 2006
Location: New York
Posts: 16
1594code is an unknown quantity at this point
Gyro not working

Our gyro used to work, but now it doesn't. We have tried using old gyros from previous years, but they do not work either. Perhaps it has something to do with our code. We are using WPILib:
InitGyro(1);
StartGyro(1);
Wait(2000);

while(1){
printf("Angle %d\r", GetGyroAngle(1));
}

The output is "0" until the gyro is rotated a large amount (usually near 360 degrees). Then the output is random, ranging from low values into the thousands, with no correlation to the degree of rotation.

Any ideas what our problem might be? Any help would be greatly appreciated!
  #2   Spotlight this post!  
Unread 12-02-2008, 18:13
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: Gyro not working

I'm not sure what type of number that will return, (int, long, etc), but I've had problems printing out longs and the like without %d. Check what the function returns.

Sorry, I'm not sure about this one.
  #3   Spotlight this post!  
Unread 12-02-2008, 18:16
fstumpo's Avatar
fstumpo fstumpo is offline
Question Everything!
FRC #1640 (SAB-BOT-AGE)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Downingtown
Posts: 9
fstumpo is an unknown quantity at this point
Re: Gyro not working

Try typecasting:

while(1){
printf("Angle %d\r", (int) GetGyroAngle(1));
}
Closed Thread


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
gyro not working johnsmith11111 Programming 4 14-02-2008 17:13
Gyro not working in Autonomous? kaszeta Programming 7 11-02-2006 01:28
CMUCam not working Inverted Programming 10 04-02-2005 19:32
Radios not working... E Jones 234 Control System 3 21-01-2005 21:58


All times are GMT -5. The time now is 12:26.

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