Go to Post I love it when awards go to the right people. - David Kelso [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 08-03-2004, 20:13
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Simple Autonomous Mode Example

A NOTE TO ANYONE USING THE ABOVE CODE:

I made a slight error in the definitions of the SECS_TO_TICKS and MSECS_TO_TICKS macros. You'll need to change them to the following:

Code:
#define SECS_TO_TICKS(a)	( ((long)(a)) * 10000 / 262 )
//And milliseconds too:
#define MSECS_TO_TICKS(a)	( ((long)(a)) * 10 / 262 )
otherwise, the values will overflow for a value greater than about 3 seconds.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #2   Spotlight this post!  
Unread 08-03-2004, 20:16
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Simple Autonomous Mode Example

I'm sure rookie teams without much programming experience will find that helpful.
__________________

  #3   Spotlight this post!  
Unread 08-03-2004, 20:22
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Simple Autonomous Mode Example

another simple auton example is our code... basicly it goes strait. then it turns about 75degrees. then it goes foward, opens its arms, and swings and knocks off the ball. it is based on a wheel counter inturpt... so you can make it go as fast or as slow as you want.
Code:
/********************************************************
************jacobs autonoumus code....******************** 
*******************************************************/
  		relay8_fwd = !rc_dig_in18;  			// Power pump only if pressure switch is on. 
  		relay8_rev = 0;
//this start start it moving... ladies and gents start your engins
		if(count >= 0 && count < 2) {
 			pwm15 = 127 + 50;			//drive strait
			pwm16 = 127 + 50;			//drive strait
//turn to get the ball
	if(count> 12 && count < 14) {
		foward = 0;					//turn off correction algoritiom (cuz were turning duh)
 			pwm15 = 127 + 50;			//make right wheel turn fowards
			pwm16 = 127 - 50;			//make left wheel turn backwards
			pwm01 = 254;				//make arm go up
		}
		if(rc_dig_in16 == 1) { 				//make sure arm doesnt go to high!!!
			pwm01 = 127;
		}
//then we have to go strait slightly to get to the ball
		if(count > 14 && count < 16) {
 			pwm15 = 127 + 50;			//go foward
			pwm16 = 127 + 50;			//go foward
			relay3_fwd = 1;				//open the gripers...
			relay3_rev = 0;				//open the grpiers...
		}
//now turn to AND close the gippers to knock/grab ball off... combo move HI-YAH
		if(count > 18 && count < 23) {
 			pwm15 = 127 - 50;			//turn the other way
			pwm16 = 127 + 50;			//turn the other way
			relay3_fwd = 0;				//close grippers
			relay3_rev = 1;				//close grippers
			
		}

//NOW we shut down motors
	if(count > 24 && count < 100) {
 		pwm15 = 127;					//turn the other way
		pwm16 = 127;					//turn the other way
		}	
/***********************************************************
*******************end jacobs auton code****************** 
***********************************************************/
as for the inturpst... that is not as hard as every one is making them out to be. there is a great white paper called inturpts for dummies, i sugjest you read it if your intrested. ive never done them before and it worked very well.
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"
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
Initializing autonomous mode Mr. Lim Programming 7 02-02-2004 07:26
how can you use a gyro in autonomous mode magical hands Programming 3 02-01-2004 13:31
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 timer Don Programming 6 09-02-2003 22:16


All times are GMT -5. The time now is 11:09.

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