View unanswered posts | View active topics It is currently Fri Oct 24, 2014 4:34 pm






Reply to topic  [ 2 posts ] 
pragma's and variables in library 
Author Message
Rookie

Joined: Sat Jun 15, 2013 7:00 am
Posts: 12
Post 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.?


Mon Aug 05, 2013 7:29 pm
Profile
Moderator
Moderator

Joined: Mon Oct 04, 2010 2:18 pm
Posts: 196
Post 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.


Fri Aug 09, 2013 10:09 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.