1

I would like to be able to exclude from the auto-including process of the current project (without renaming the extension or delete it) a sketch with pde or ino extension that is used in certain circumstances only.

How can I do this?

I currently use Visual Micro to manage projects on Arduino.

Greenonline
3,1527 gold badges36 silver badges48 bronze badges
asked Mar 25, 2016 at 16:19

1 Answer 1

1

One possible approach is to guard the body of that sketch with an #ifdef ... #endif pair, and use Visual Micro's "Project Properties" to define (or not) a preprocessor symbol. [If the .ino or .pde in question is used as a #include file, you would instead guard all the #include instances.]

Refer to the "Project Defines" page at visualmicro.com for how to define a preprocessor symbol and its value. [Via: Tools> Options> Visual Micro> Compiler> Show Build Properties] Also see How do I add additional compiler switches in Visual Studio.

If necessary, you can use other tests besides #ifdef to control compilation. The first link above shows the following example.

#if USBPORT > 3
....your code here....
#endif
answered Mar 25, 2016 at 16:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.