So I've finally finished my coding for my project and I'm busy tiding up my code. I was wonder if Arduino has a explicit option like VB.net or some other option to let you know if you have variables defined that you aren't using?
Keep in mind also that the compiler is going to do away with unused variables under the hood. I applaud your desire to keep your code clean however, it definitely promotes better code to do things like that.
It works finding for unused variables declared in a void, but not if you declare a variable outside of it. Eg I put
And it does not report that its unused.
That's because it is not unused. If you explicitly define a value, you are using the variable.
If you know what value the variable should have, then you know that you are going to use it.