Skip to content

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.

Source File Categorisation

The files have been categorized in the following types:

  1. General Source Files
  2. Port-related Source Files
    • Digital Port Source Files
    • Analog Port Source Files
  3. Timers/Timing Source Files
  4. Hardware Serial Source Files
  5. Wiring-related Source Files
  6. Others

General Source Files

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.

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.

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;
}

Port Related Source Files

Timers/Timing Source Files

Hardware Serial Source Files

Wiring-related Source Files

Others

See Also

Clone this wiki locally