-
Notifications
You must be signed in to change notification settings - Fork 0
2. Introduction to Source files and the Building Process.
Animesh Srivastava edited this page Jul 1, 2019
·
7 revisions
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
- Digital Port Source Files
- Analog Port 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.
1. 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.
2. 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;
}