ROBOTC.net forums
http://robotc.net/forums/

pragma's and variables in library
http://robotc.net/forums/viewtopic.php?f=66&t=6498
Page 1 of 1

Author:  Palione [ Mon Aug 05, 2013 7:29 pm ]
Post subject:  pragma's and variables in library

Are duplicate pragma statements required in both the library.h and the program which #includes the library.h?
Also, what about variable definitions?
Should they be defined in library.h and again in main program?
RING IT UP - LIBRARIES
Assuming I'm using all 4 robots (gripper ir, gripper gyro, scissor ir, scissor gyro) each in it's own section of the Ring It Up 2 min long main program,
should i have 4 function libraries - one for each robot?
And again, do i duplicate the pragmas, so the gripper ir library.h has the same pragmas as the gripper ir program, etc.?

Author:  parkway [ Fri Aug 09, 2013 10:09 am ]
Post subject:  Re: pragma's and variables in library

Your pragma statements can't be in the header file; they have to be in your program. What you can do is put the pragma statements in the header file as a comment, and then paste it into your program. That way, you can ensure that all of your sensors are set up correctly.

With your variables, you'll probably want to use parameters in your functions as in this example: http://www.education.rec.ri.cmu.edu/previews/robot_c_products/teaching_rc_tetrix_preview/reference/hp_functions.pdf

Because the robots for Ring it Up are configured differently, you're right, you can't just make one library.

Sorry for the delay in the response. I hope that helps. If you have any other questions, please let us know.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/