I think the commentary for the code is kind of distracting when I'm trying to mess with it in my sketchpad. What I would like to do is download the code without the commentary and put that into my sketch. Then, when I have to refer to the explanations, I could toggle between a text file of the full version that has the commentary in it and my commentary-free programming code. Is there a place to download just the code?
That is a very strange and unusual request. Most people complain that sketch authors don't put in enough comments. Good commenting is a very important part of writing a good program, and should never be discouraged. Do you really find them distracting?
Anyway I know of no utilities that would automatically strip out all comments in a source text file, but who knows, someone might know of one.
Lefty
The compiler strips out all comments
Try python - Remove C and C++ comments using Python? - Stack Overflow -
or SED - http://bash.cyberciti.biz/academic/sed-remove-c-cpp-comments/
robtillaart:
The compiler strips out all commentsTry python - Remove C and C++ comments using Python? - Stack Overflow -
or SED - http://bash.cyberciti.biz/academic/sed-remove-c-cpp-comments/
Well, I was going to suggest Perl or awk, but even sed will do. Or a vi macro, or you could even use EMACS. ]
But the nicest way of course is to write an Arduino sketch. Send the application code to the Arduino and get it back without comments.
Maybe it could also do
-
bugmonitoring to like "if (x=3)"
-
detect typos
-
correct variable caseing, e.g. #defines UPPERCASE, normal vars first char lowercase
-
update the layout to be good looking (indentation)
-
add spaces in assignments "x=3" ==> "x = 3"
-
Extract some meta info e.g. a list of function names ( to create a .h file ?)
-
Reference list - what function uses which global vars (R or W or RW)
-
...
So many possibilities so little time
Would be a nice exercise in string programming.