Defines

A define a useful C component that allow you to give a name to a value before the program is compiled.

You can define numbers in arduino that don't take up any program memory space on the chip. Arduino defines have the same syntax as C defines:

#define constantName value

Note that the # is necessary. For example:

#define ledPin 3

The compiler will replace any mentions of ledPin with the value 3 at compile time.

Reference Home