My understanding is that if I put: #define DISPLAY
at the top of a sketch, and lower down in the sketch put: #ifdef DISPLAY some code #endif
then the some code is compiled into the .hex and if I remove the initial definition, or comment it out then the some code is skipped.
The weird thing is that in the same sketch I am working with I have one set of these #defines which work and a second set which still compiles in the code despite the #define being commented out.
Your understanding of what is the behavior, is correct - so if code is generated it means the define exists. Note that you can also associate a value to a define « variable » so there is a difference between #if and #ifdef
➜ long story short post a code example of your claim.
When the IDE is launched, the setup() function comes first and then the loop() function -- why have you broken the tradition/style and have put loop() at the top of setup() (post #6) though nothing wrong?