O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with tabs

When creating a new tab, the first thing we need to decide is what is going to the tab. For example in this section, we will create two new tabs. One will be named led.h and the other led. The led.h file will contain the constant definition, and the led file will contain code.

When we create a tab with the .h extension we are creating, what is known in the C language, a header file. A header file is a file that contains declarations and macro definitions. These tabs can then be included in the normal code tabs. In the next section, we will see another type of tab which is the cpp tab.

Once the new tabs are created, add the following code to the led.h tab:

#ifndef LED_H
#define LED_H #define LED_ONE 3 #define LED_TWO 11 #endif ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required