Values in the "Defines - Configuration" field are
configuration dependent, you can have different defines in your sketch,
depending on your configuration (e.g. "Debug" and "Release").

You can also enter values in the field below, named "Defines - Project",
these are configuration independent.

You can then use these defines like ordinary #defines
written into the code, like in this example:

#if USBPORT > 3....your code here....#endif

Using build properties as defines

Build properties are parameters that control the compilation and upload
process. You can take advantage of these build properties and use them in
project property defines. Refer to the build properties by putting them in curly
braces:

Visual Micro will replace {upload.maximum_size}
with the actual value of that build property, e.g. 30720 in case of an Arduino
Nano board.

An equivalent hardcoded #define in the code would look like this:

#define PROGMEM_SIZE 30720

With this type of defines, you can, for example, adjust your sketch to the board you are
using without changing your source code. With the PROGMEM_SIZE example above, you
could compile parts of your sketch only if the board's program memory is big
enough:

#if PROGMEM_SIZE > 50000....your code here....#endif

Where do I find the build properties?

You can create a complete list of the available build properties with this
option:

By using our website you are consenting to our use of cookies which includes an ASP Session Id, Acceptance of cookies and Google Analytics tracking. The forum enables you to register your personal details which will not be shared with any third parties. If you register and subsequently would like to have your user details deleted then please use the Contact Us or send a PM to the forum Admin.