Author Topic: beginner questions about AVR studio 4  (Read 1649 times)

0 Members and 1 Guest are viewing this topic.

Offline ProctorTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
beginner questions about AVR studio 4
« on: June 17, 2012, 07:59:39 PM »
Hello everyone,

I'm building my first robot using the $50 guide.

I did all the soldering but i am having trouble with the software.

It all seems so confusing.

Right now I am stuck in AVR studio 4 puzzled.

I guess to begin,

what's the difference between "source files", "Header Files", "External Files", and "Other files".

I have blindly tried to drag in what the tutorial told me to so I have many files in each category. i.e. a2d.c, buffer.c, photovore_v1.c, rprintf.c, timer.c, timerx8.c, uart.c. And etc for the header files.


Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: beginner questions about AVR studio 4
« Reply #1 on: June 18, 2012, 09:28:18 AM »
Howdy,

this is actually more of a programming question, and it relates to C, not specifically AVR studio.  BUT:

Source files (*.c, *.cpp) contain the actual control code.  When people talk about "writing code", they write source files to actually DO things.

Headers: Header files contain helper code that, on its own, doesn't do anything.  For example, a robot might use a structure of variables, call it "speedStruct", that contains the speeds of all the motors.  This might be used in multiple source files, so it makes a lot of sense to define it in one place then use it in multiple places.  Headers let you do that.

Headers do a lot more, though, and it's hard to go into in a forum post (read a C book!).  For example, in C, if you have a function, you have to declare the function to the code -- you have to tell the computer that your program has a specific piece of functionality.  Headers are used to declare the functions so all of your code can use it.

I'm not sure what you mean by "external files" and "other files".  Do you mean the libraries?

MIKE
Current project: tactile sensing systems for multifingered robot hands

 


Get Your Ad Here