Go to Post It made me proud to know that we have corporate sponsors with genuine interest. - galewind [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
  #4   Spotlight this post!  
Unread 02-01-2004, 13:31
GregTheGreat's Avatar
GregTheGreat GregTheGreat is offline
Registered User
no team
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 386
GregTheGreat has a spectacular aura aboutGregTheGreat has a spectacular aura aboutGregTheGreat has a spectacular aura about
Re: how can you use a gyro in autonomous mode

I know what the best bennifit of a gyro is (in my mind)... I consider it a backup device... using it with your counter you can make a very sound auton. program. I am searching through my programs last year to find an example of what I am talking about but my programs are on my old computer so when I backed them up on CD's they got thrown all over the place.

Basically it would work like this....

you could use a go-sub like this
Code:
 

	Gyrocounter:

	if sensor1 > 130 then Gyro1:             'Gyro Sensor Clockwise

        if sensor1 < 128 then Gyro2:             'Gyro Sensor Counterclockwise

	Goto Gyro3:

	Gyro1:
    
	cont = cont + sensor1 - 129 

	Goto Gyro3:

	Gyro2:
    
	cont = cont + sensor1 - 129        
    
	Gyro3:

	Pass:

	Return
Then incorperate your code like this....

Code:
         Right_Gyro:

	gosub gyrocounter

	if cont < 32000 then 

	relay1_fwd = 1 		'Two Wheel Drive On

	relay1_rev = 0 		'Four Wheel Drive Off
                
	endif	

        On indc goto RGyro, RGyro1, RGyro2, RGyro3, RGyro4

	RGyro:			'Half Circle

	p1_y = 175		'Right Front Wheel Forward

	p2_x = 175		'Right Rear Wheel Forward

	p2_y = 250		'Left Front Wheel Forward

        p3_x = 250		'Left Rear Wheel Forward

	If cont > 37800 then RGyro1

	Goto Main:

	RGyro1:			'Half Circle

	indc = 1

	relay1_fwd = 0 		'Two Wheel Drive Off

	relay1_rev = 1 		'Four Wheel Drive On
	
	p1_y = 175		'Right Front Wheel Forward

	p2_x = 175		'Right Rear Wheel Forward

	p2_y = 250		'Left Front Wheel Forward

        p3_x = 250		'Left Rear Wheel Forward

	If cont > 38200 then cycle = 0
	
	If cont > 38200 then goto RGyro2

	Goto Main:

	RGyro2:			'Straight Forward

	indc = 2

	p1_y = 253		'Right Front Wheel Forward

	p2_x = 253		'Right Rear Wheel Forward

	p2_y = 253		'Left Front Wheel Forward

	p3_x = 253		'Left Rear Wheel Forward
	
	If cycle >= 130 then RGyro3

	Goto Main:

	RGyro3:

	indc = 3

	p1_y = 127		'Right Front Wheel Stop

	p2_x = 127		'Right Rear Wheel Stop

	p2_y = 127		'Left Front Wheel Stop

	p3_x = 127		'Left Rear Wheel Stop

	If cycle >= 140 then RGyro4
You can get the basic idea on how to program a gyro (id the variabales)

REMEMBER
This is pbasic coding you will need to convert it into C for this years controller... on Innovation they have the "pamphlet" they created to show you how to do many of these functions... I will work on making some C programming for a gyro but I have many other things to work on for my team so I do not know how productive I will be...

If you need help with the coding give me something to work with... a general idea is hard to show you what you want but if you give me a very spacific idea I would be more than happy to help you out ne way I can.

If you need the help contact me...
AOL IM- GregTheGreat04 (no spaces)
E-mail- g.ullstam@comcast.net

Good Luck,

-Greg The Great
 


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