Log in

View Full Version : Can You help us??? (programming questions)


HuskieRobotics
24-02-2004, 20:27
We would like to know a few things. First, Are there any default variables that we can use?? if so what are they?? Second, Where are all of the variables for the program defined??? Thanks!!

jacob_dilles
24-02-2004, 21:19
besides the control variables ( that should only change loop-to-loop ) first has not made you any variables. you put any variables you want in the user_routines.c file in the section right under where it sais
/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/
/* EXAMPLES: (see MPLAB C18 User's Guide, p.9 for all types)
unsigned char wheel_revolutions = 0; (can vary from 0 to 255)
unsigned int delay_count = 7; (can vary from 0 to 65,535)
int angle_deviation = 142; (can vary from -32,768 to 32,767)
unsigned long very_big_counter = 0; (can vary from 0 to 4,294,967,295)
*/ and if you wana get realy fancy ( which i dont think, from this post, you are too intrested in ) you can go into the user_routiens.h file and do typedefs... etc but if you wana declare a counter variable, say, you would simply put unsigned counter1 = 0; and there ya go. simple eh? theres a bunch of variable types, im not even gonna start goin there. good luck guys