Introduction to Arduino: Code Compiling Process

Home

Compiling and Uploading Code

Here is a summary of how the Arduino IDE (Integrated Development Environment) compiles the code in your sketch into machine instructions and uploads it onto the Arduino:

1. A number of things have to happen for your Arduino sketch to upload onto the Arduino board.

2. First, the Arduino environment verifies that that the code is correct C or C++ (two common programming languages).

3. It then gets passed to a compiler, which turns the human-readable code into machine-readable instructions.

4. Then, your instruction file gets linked with the standard Arduino libraries that provide basic built-in functions like digitalWrite() or Serial.print().

5. This finished instruction file is then uploaded (transmitted) over the serial connection (most likely USB) to the Arduino.

The above description was adapted by Mr. Stewart from this resource.

Check Your Understanding

1. When you compile a program, the Arduino IDE (Integrated Development Environment) first checks for errors by your sketch.  It then translates human-readable into machine-readable using a(n) .

2. Afterward, built-in like digitalWrite and pinMode are  with your compiled code to create a single output machine instruction file.

3. When you  a sketch, the Arduino IDE transmits the instruction file you've written over a connection (such as USB) to the Arduino to run.

Back