Arduino Tutorial - How the code structure works
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Re: Arduino Tutorial - How the code structure works
Essentially. Those files are considered the "Libraries"
- cosmith71
- Posts: 1432
- Joined: Fri Mar 29, 2013 3:51 pm
- Location: Oklahoma City
Re: Arduino Tutorial - How the code structure works
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.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 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
-
wolffman64
- Posts: 62
- Joined: Mon Feb 24, 2014 9:38 pm
- Location: Sydney, Australia
Re: Arduino Tutorial - How the code structure works
Thanks Colin, appreciate your help!
- cosmith71
- Posts: 1432
- Joined: Fri Mar 29, 2013 3:51 pm
- Location: Oklahoma City
Re: Arduino Tutorial - How the code structure works
You're welcome!
-
SEANTADEZ
- Posts: 16
- Joined: Tue Feb 25, 2014 8:38 pm
- Contact:
Re: Arduino Tutorial - How the code structure works
Very Helpful, thanks a lot
-
snoopy60
- Posts: 14
- Joined: Thu Apr 04, 2013 6:11 pm
Re: Arduino Tutorial - How the code structure works
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.
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.
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
-
snoopy60
- Posts: 14
- Joined: Thu Apr 04, 2013 6:11 pm
Re: Arduino Tutorial - How the code structure works
Thanks Roberto!!!!
- ffitch63
- Posts: 1
- Joined: Wed Feb 08, 2017 7:20 pm
Re: Arduino Tutorial - How the code structure works
Thank you for this tutorial! It has helped me to understand tremendously...since I am a absolute newbie to programming. 
- cosmith71
- Posts: 1432
- Joined: Fri Mar 29, 2013 3:51 pm
- Location: Oklahoma City
Re: Arduino Tutorial - How the code structure works
Glad it helped!
--Colin
--Colin