Page 1 of 1

Re: Arduino Tutorial - How the code structure works

Posted: Wed Mar 12, 2014 7:04 pm
by lnevo
Essentially. Those files are considered the "Libraries"

Re: Arduino Tutorial - How the code structure works

Posted: Thu Mar 13, 2014 5:52 am
by cosmith71
wolffman64 wrote:Hi Colin,

Thanks for the great write up, now I understand the basic part of it.
One question I have is regarding the first "include" part. I assume that those are the files that are unique for the RA, and defines how they are all wired into the arduino board etc, and what kind of input/output/variables you get from each function. Are they described in any more detail anywhere, for instance the "tempsensor" file, what is coming out of it etc, or have I completely misunderstood this?
The #include statements essentially add standard code for doing stuff into your sketch (libraries, as Lee said). Instead of having to put a bunch of code into every single sketch to handle temperature sensors, we just #include a standard file that does it. It makes the sketch tidier and much easier to read and deal with.

The libraries are generally located at c:\Users\xxxxxx\Documents\Arduino\libraries, where xxxxxx is your user name. You can view them with any standard text editor (like notepad). There are .h files and .cpp files. The .cpp files are a little more interesting to look at and make more sense to the lay person.

Here is a good reference as well:

http://www.easte.net/RA/html/index.html

Hope this helps!

--Colin

Re: Arduino Tutorial - How the code structure works

Posted: Thu Mar 13, 2014 3:34 pm
by wolffman64
Thanks Colin, appreciate your help!

Re: Arduino Tutorial - How the code structure works

Posted: Thu Mar 13, 2014 8:59 pm
by cosmith71
You're welcome!

Re: Arduino Tutorial - How the code structure works

Posted: Mon Mar 17, 2014 9:15 pm
by SEANTADEZ
Very Helpful, thanks a lot

Re: Arduino Tutorial - How the code structure works

Posted: Wed Apr 02, 2014 4:36 pm
by snoopy60
Thanks so much, this is fantastic. I am having a ball studying this "tutorial".
Question: looking at the library on my c drive, I see the many of the folders have a CPP file and an H file. Are these interchangeable? Why the different files?
Just the beginning of learning this stuff, but what a great start.

Re: Arduino Tutorial - How the code structure works

Posted: Wed Apr 02, 2014 4:40 pm
by rimai

Re: Arduino Tutorial - How the code structure works

Posted: Thu Apr 03, 2014 4:28 pm
by snoopy60
Thanks Roberto!!!!

Re: Arduino Tutorial - How the code structure works

Posted: Thu Feb 16, 2017 7:07 am
by ffitch63
Thank you for this tutorial! It has helped me to understand tremendously...since I am a absolute newbie to programming. ;)

Re: Arduino Tutorial - How the code structure works

Posted: Thu Feb 16, 2017 7:15 am
by cosmith71
Glad it helped!

--Colin