-
Notifications
You must be signed in to change notification settings - Fork 0
2. Introduction to Source files and the Building Process.
The Arduino core contains all the built-in functions source files.
The files have been categorized in the following types:
- General Source Files
- Port-related Source Files
- Timers/Timing Source Files
- Hardware Serial Source Files
- Wiring-related Source Files
- Others
The General Source Files category encapsulates all the source file that is related with built-in functions required for general Arduino Language Programming and core functioning.
i). Arduino.h
We know that a .h
file describes the structure of the library and declares all its variables and functions
The Arduino.h files contain:
- The declaration of mostly used built-in functions of the Arduino Programming Language. Example:
digitalRead()
,pinMode()
, etc. - Macro functions for general functions, not limited to
rand()
,min()
, etc.
ii). main.cpp
The main.cpp
is very important as it describes the basic program structure:
int main(void)
{
init();
initVariant();
#if defined(USBCON)
USBDevice.attach();
#endif
setup();
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
return 0;
}
The Port Related Source Files category encapsulates all the source file that is related with built-in functions required for general port functioning. For example: digitalRead()
, pinMode()
, etc.
We categorize the files in two sub-categories: