Need help with an idea

The purpose of the setup() function is to establish the environment in which the program operates. It might set the state of sensors, controller pins, data connections, window handles, etc. This is probably where your "targeting" function should go. The strange thing about setup(), however, is that you should never "call" it in your own code. It automatically gets called on power-on and is never called again unless there is a reset or it is re-powered. You can see how this is coded in main.cpp, which you can find on your IDE path:

  • hardware\arduino\avr\cores\arduino\main.cpp*