![]() |
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. |
Re: auton variables
I'd declare my variable like this:
Code:
/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/Code:
void User_Autonomous_Code(void)Code:
/* Add your own autonomous code here.*/ |
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 |
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?
|
Re: auton variables
[ code]printf("Hello, world!");[/code] (without the first space) yields
Code:
printf("Hello, world!"); |
| All times are GMT -5. The time now is 03:57. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi