Go to Post the hardest task this year is the same as every other year: getting the engineers out of the crate so you can close it up and the FedEx guy can haul it away! - KenWittlief [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 26-03-2005, 11:59
sirbleedsalot's Avatar
sirbleedsalot sirbleedsalot is offline
Registered User
FRC #0939
Team Role: Student
 
Join Date: Feb 2004
Location: New Effington South Dakota
Posts: 178
sirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura about
auton variables

I am trying to create an autonomous program. Currently I just have everything where it says "add your autonomous code here" however I would like to change it. What I want to do is have some variable like say slow which I could put in my autonomous to make the motors drive at half speed. From what I have read I have to define my variables in the user routines fast.c file like this



/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/
#define slow



however I don't understand how that would know to set pwms 14 and 15 to 190. I am missing a large portion of the puzzle.
__________________
our web site
  #2   Spotlight this post!  
Unread 26-03-2005, 12:13
Goobergunch Goobergunch is offline
Registered User
FRC #1168 (Malvern Robotics)
Team Role: Alumni
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Paoli, PA
Posts: 246
Goobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to all
Re: auton variables

I'd declare my variable like this:
Code:
/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/
int slow;
and further down:
Code:
void User_Autonomous_Code(void)
{
slow = 190;
and then even further down:
Code:
/* Add your own autonomous code here.*/

pwm14 = slow;
pwm15 = slow;
  #3   Spotlight this post!  
Unread 26-03-2005, 12:18
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: auton variables

I'd suggest starting at the beginning and doing some reading on basic C. There are a bunch of whitepapers: http://www.chiefdelphi.com/forums/pa... SC&sort=date

These look like good candidates:
http://www.chiefdelphi.com/forums/pa...le&paperid=396
http://www.chiefdelphi.com/forums/pa...le&paperid=380
http://www.chiefdelphi.com/forums/pa...le&paperid=253
  #4   Spotlight this post!  
Unread 26-03-2005, 14:11
sirbleedsalot's Avatar
sirbleedsalot sirbleedsalot is offline
Registered User
FRC #0939
Team Role: Student
 
Join Date: Feb 2004
Location: New Effington South Dakota
Posts: 178
sirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura about
Re: auton variables

Thanks for your help, I had already read some of those white papers, however I was confused by them. Also how do you add the code quote to your posts?
__________________
our web site
  #5   Spotlight this post!  
Unread 26-03-2005, 14:24
Goobergunch Goobergunch is offline
Registered User
FRC #1168 (Malvern Robotics)
Team Role: Alumni
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Paoli, PA
Posts: 246
Goobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to allGoobergunch is a name known to all
Re: auton variables

[ code]printf("Hello, world!");[/code] (without the first space) yields
Code:
printf("Hello, world!");
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
Auton + Functions ten3brousone Programming 0 27-02-2005 20:11
testing Auton and IR sensors at events KenWittlief General Forum 2 08-03-2004 16:40
Need help with Variables ? David Bryan Programming 5 23-02-2004 07:42
VB Program to monitor robot variables DanL Programming 7 15-02-2002 22:35


All times are GMT -5. The time now is 10:58.

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