|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
Re: auton variables
I'd declare my variable like this:
Code:
/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/ int slow; Code:
void User_Autonomous_Code(void)
{
slow = 190;
Code:
/* Add your own autonomous code here.*/ pwm14 = slow; pwm15 = slow; |
|
#3
|
||||||
|
||||||
|
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
|
||||
|
||||
|
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?
|
|
#5
|
|||
|
|||
|
Re: auton variables
[ code]printf("Hello, world!");[/code] (without the first space) yields
Code:
printf("Hello, world!");
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |