Mastering Arduino
上QQ阅读APP看书,第一时间看更新

Exploring the IDE

There are four areas that make up the main development window of the IDE. The following screenshot shows these four areas:

The menu bar for the IDE functions like menu bars in other applications, where you click on one of the options, and a submenu appears with more options. We will look at some of the commonly used menu options as we go through this book.

The command bar provides quick access to five of the most commonly used commands. These commands are, from left to right, verify, upload, new, open and save. The verify command will attempt to compile the sketch in order to verify that there is nothing wrong with the code. The upload command will attempt to build and upload the sketch to the attached Arduino. The new command will create a new sketch. The open command will open a sketch. Finally, the save command will save the sketch.

Note: In order to upload a sketch, you must have an Arduino connected to the computer you are working on and configured in the IDE otherwise you will receive an error. We will look at how to do this in the Configuring the Arduino within the IDE section.

The coding area is where we write the code for the Arduino. You will notice that when we start a new sketch, two functions (setup and loop) are automatically created in the main tab. We will be working with these functions a lot in this book. We will be looking at what these two functions do at the end of this chapter when we create our first sketch.

The status area is used by the IDE to let us know what is happening when the IDE is doing something like compiling, uploading or verifying a sketch.

In order to upload a sketch to an Arduino, we need to connect the Arduino to the computer the IDE is running on with a USB cable and configure it in the IDE. Configuring the Arduino within the IDE requires us to tell it what type of Arduino we are using and what port it is on. Let's see how to do this.