Go to Post If I run into some of your team's student coaches/drivers on the field of battle someday, I still might ask 'em what they're doing after high school. :) - Ken Patton [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 02-01-2004, 01:18
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
Re: how can you use a gyro in autonomous mode

I shouldn't even be writing this, but i felt like i needed to. The second topic in this forum asks the exact same thing (found here:http://www.chiefdelphi.com/forums/sh...ad.php?t=23268) and i gave them the following response:

Quote:
Originally Posted by myself in another forum
one piece of advice, before bringing up something that is not completely obscure, search the forums and also just go the the appropriate forum and make sure to change the start date from one week to one year or something along those lines. here's one forum on gyroscopes and C and the like:
http://www.chiefdelphi.com/forums/sh...ad.php?t=23071
I cannot say it enough, search, search, search!

As i just realized though, that doesn't give autonomous code. All a gyro can really do is tell you which way you're pointing, nothing more. So there really is no way to give sample code except for the following which just integrates the gyro output to give you one number which shows how far you've turned.

Code:
int theta=0;  //in global variables

// from here on in autonomous section or what have you

signed char gyro = (GYRO-127)*G_ADJUST; //GYRO being the macro for wherever your gyro is attached
                                          //and G_ADJUST is a constant to adjust to degrees

if (theta+gyro>=360)  //rolling from 359 to 0 and around again
   theta+=gyro-360;
else if (theta+gryo<0)  //rolling from 0 to 359 and around again
   theta+=gyro+360;
else
   theta+=gyro;
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year

Last edited by Anthony Kesich : 02-01-2004 at 01:38.
 


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
Programming Autonomous mode Jared Stofflett Programming 3 11-11-2003 09:32
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous mode AntmanIV General Forum 1 17-02-2003 13:30
autonomous mode timer Don Programming 6 09-02-2003 22:16
autonomous mode? bigwalt Technical Discussion 1 21-01-2003 01:14


All times are GMT -5. The time now is 19: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