Go to Post I blame FIRST for being the best thing that has happened to me. - vivek16 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-10-2005, 03:18
Doogie's Avatar
Doogie Doogie is offline
Reconnaissance Captain
FRC #1388 (Eagle Robotics)
Team Role: Scout
 
Join Date: May 2005
Rookie Year: 2005
Location: Arroyo Grande, CA
Posts: 7
Doogie is an unknown quantity at this point
Legal to add .c file?

Would it be legal to add a .c file to the code which contains functions that could be called by the autonomous AND user routines?
  #2   Spotlight this post!  
Unread 12-10-2005, 05:45
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: Legal to add .c file?

Yes it is perfectly legal to do so.
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #3   Spotlight this post!  
Unread 12-10-2005, 11:16
Billfred's Avatar
Billfred Billfred is offline
...and you can't! teach! that!
FRC #5402 (Iron Kings); no team (AndyMark)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: The Land of the Kokomese, IN
Posts: 8,547
Billfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond reputeBillfred has a reputation beyond repute
Re: Legal to add .c file?

Quote:
Originally Posted by Bharat Nain
Yes it is perfectly legal to do so.
<insert standard disclaimer here that it may change for 2006, so make sure to read the manual after Kickoff. but I'd imagine it's a relatively safe bet.>
__________________
William "Billfred" Leverette - Gamecock/Jessica Boucher victim/Marketing & Sales Specialist at AndyMark

2004-2006: FRC 1293 (D5 Robotics) - Student, Mentor, Coach
2007-2009: FRC 1618 (Capital Robotics) - Mentor, Coach
2009-2013: FRC 2815 (Los Pollos Locos) - Mentor, Coach - Palmetto '09, Peachtree '11, Palmetto '11, Palmetto '12
2010: FRC 1398 (Keenan Robo-Raiders) - Mentor - Palmetto '10
2014-2016: FRC 4901 (Garnet Squadron) - Co-Founder and Head Bot Coach - Orlando '14, SCRIW '16
2017-: FRC 5402 (Iron Kings) - Mentor

94 events (more than will fit in a ChiefDelphi signature), 14 seasons, over 61,000 miles, and still on a mission from Bob.

Rule #1: Do not die. Rule #2: Be respectful. Rule #3: Be safe. Rule #4: Follow the handbook.
  #4   Spotlight this post!  
Unread 12-10-2005, 12:56
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Legal to add .c file?

...yes, it should work just fine. We do it all the time.

On a side note:
For good programming practice, you'll want to put the function prototypes of your functions into a .h file of the same name. Then #include the .h file at the top of the other files that you want to use the functions in.
__________________

Don't PANIC!
S. P. A. M.
  #5   Spotlight this post!  
Unread 12-10-2005, 20:14
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Legal to add .c file?

Absolutely. Basically, you can do anyhting you want as far as code is concerned. There is nothing that is restricted. The hardware is designed such that there is no way you can screw up code in a way that would cause the E-Stop, team numbers etc to stop working.
__________________
1139 Alumni
  #6   Spotlight this post!  
Unread 12-10-2005, 23:27
CJO's Avatar
CJO CJO is offline
Emeritus Pain in the $@#$@#$@#
AKA: Christopher J. O'Connell
None #1097 (Site 3 Engineering)
Team Role: Alumni
 
Join Date: Feb 2003
Location: Latrobe (over the rainbow), CA
Posts: 217
CJO will become famous soon enoughCJO will become famous soon enough
Re: Legal to add .c file?

In fact, (although not the best of programming practices) you can just create an .h file called "include.h," and put all of your other includes in it, and then just include "include.h" in your c files.

The drawback is that every file includes every header, which may not always be desirable, HOWEVER, for beginning programmers, this can simplify the process of "which files do I need to include?"
__________________
Team 1097 -- Site 3 Engineering
~~~~~~~~~~~~~~~~~~~~
2003 Sacramento Rookie All Star
2003 Silicon Valley Rookie All Star
2004 Sacramento Engineering Inspiration Award
2004 Sacramento Visualization Award
2004 Outstanding Volunteer Award (G. Glasser)
2004 Silicon Valley Sportsmanship Award
2004 National Visualization Runner Up
2004 Cal Games Finalist
2005 Sacramento Sportsmanship Award
2005 Sacramento #1 seed
2005 Sacramento Finalist

2005 Silicon Valley Sportsmanship Award
2005 Silicon Valley #1 Seed
2005 Silicon Valley Finalist

  #7   Spotlight this post!  
Unread 13-10-2005, 01:13
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Legal to add .c file?

Quote:
Originally Posted by CJO
In fact, (although not the best of programming practices) you can just create an .h file called "include.h," and put all of your other includes in it, and then just include "include.h" in your c files.

The drawback is that every file includes every header, which may not always be desirable, HOWEVER, for beginning programmers, this can simplify the process of "which files do I need to include?"
Many software people consider this to be a very bad practice, and as such I don't advise it, especially for beginning programmers. No sense in starting off by picking up a bad habit.
  #8   Spotlight this post!  
Unread 13-10-2005, 01:40
Doogie's Avatar
Doogie Doogie is offline
Reconnaissance Captain
FRC #1388 (Eagle Robotics)
Team Role: Scout
 
Join Date: May 2005
Rookie Year: 2005
Location: Arroyo Grande, CA
Posts: 7
Doogie is an unknown quantity at this point
Re: Legal to add .c file?

Alright, thanks a lot.
  #9   Spotlight this post!  
Unread 13-10-2005, 17:03
CJO's Avatar
CJO CJO is offline
Emeritus Pain in the $@#$@#$@#
AKA: Christopher J. O'Connell
None #1097 (Site 3 Engineering)
Team Role: Alumni
 
Join Date: Feb 2003
Location: Latrobe (over the rainbow), CA
Posts: 217
CJO will become famous soon enoughCJO will become famous soon enough
Re: Legal to add .c file?

It depends on the scope of your program. while I would never use it in a major project, the smaller PIC programs lend themselves to centralizaiton of some things, and it can really simplify the process.
__________________
Team 1097 -- Site 3 Engineering
~~~~~~~~~~~~~~~~~~~~
2003 Sacramento Rookie All Star
2003 Silicon Valley Rookie All Star
2004 Sacramento Engineering Inspiration Award
2004 Sacramento Visualization Award
2004 Outstanding Volunteer Award (G. Glasser)
2004 Silicon Valley Sportsmanship Award
2004 National Visualization Runner Up
2004 Cal Games Finalist
2005 Sacramento Sportsmanship Award
2005 Sacramento #1 seed
2005 Sacramento Finalist

2005 Silicon Valley Sportsmanship Award
2005 Silicon Valley #1 Seed
2005 Silicon Valley Finalist

Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Aspartame shyra1353 Chit-Chat 8 20-01-2004 22:41
Dashv2.ocx dependency file now available archiver 2000 0 23-06-2002 22:00
Improving PBASIC: Request for Comments Greg Ross Programming 19 16-02-2002 22:14


All times are GMT -5. The time now is 03:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi