Hardware Reference
In-Depth Information
Header files : Our example uses Motor.h , but you may have many other header files in your
project. Those would all go in this directory.
Implementation file : This example uses Motor.cpp , but other libraries can have one or more
implementation files.
License : The license your libraries will be distributed under, such as the GNU Public License
(GPL).
keywords.txt : This contains the formatting to highlight the functions and variables that a user
will see in the Arduino IDE.
All of these directories and files need to be compressed into a .zip compressed archive file for download and
installation by extracting them into the Arduino libraries folder. Let's examine critical features in more detail.
Examples Folder
The example folder contains all of your example sketches that demonstrate features and instructions. By having
examples, your library will appear in the “examples” menu. When your library does not have examples, it will only be
found in the “import library” menu. There are occasions where you write several libraries and they all share the same
library. In this case, it makes sense to omit additional examples.
Note
new users may be confused and not be able to locate the library if it does not have at least one example.
License
The license file can be anything from GPL to “all rights reserved.” If you are building on top of open source software,
the license should be compatible. For Open Hardware check out the Open Source Hardware Association (OSHWA)
at http://www.oshwa.org/ ; they maintain the definition of Open Hardware and have helpful information on what
licenses are available.
keywords.txt
This file consists of the datatypes, methods, functions, and constants sections. A data type in parenthesis denotes the
section. However, a tab character must separate these key and value pairs. Any spaces will cause the parsing to fail,
with no indication as to what is wrong.
# Datatypes (KEYWORD1)
Motor KEYWORD1
# Methods and Functions (KEYWORD2)
setMotorVel KEYWORD2
setLeftMotorSpeed
KEYWORD2
setRightMotorSpeed
KEYWORD2
# Constants (LITERAL1)
motor1Dir
LITERAL1
 
 
Search WWH ::




Custom Search