Hi,
Good questions and maybe we can extend the new item examples to show more flexibility and clarity.
You can create .cpp/h files in anyway that you choose. Our exmple has been designed to show how Arduino often implements a class and then makes it globally available to the code (via core or #include).
Our example implements the same logic to create and instantiate a class as does the Arduino AVR "Serial" class. Some boards have just Serial and some have Serial, Serial1, Serial2 etc. Each is instantiated at startup and extern applied. Then accessed via code as Serial.println("Hello world") or Serial2.println("Hello world")
Some people prefer static classes and in many cases you might want to instantiate objects only in the code that actually uses them. Then you do not need externa.
It is entirely up to you and please do submit any recomended alternative "New Item" templates that you believe would be useful for Visual Micro to implement.
The init() is simply an example to show less experinced users how they might add a method to initialise some base values for their class. Again you can use standard c++/arduino/gcc and entirely ignore our example in part or entirity.
Quote:Looking back over the revision history, I see that these were very conscious choices and listed as revision features in revision 1208.19.
I am unclear as to what prompted this question exactly or how to answer...
There was "library versioning" released last year. You can create arduino libraries of your own by following the arduino guidelines or looking at how existing libraries are structured.
The arduino libraries carry version numbering facility in an external text file called library.properties. We build on that system to provide a more fluent way to use different versions of the same libraries accross multiple projects.
Normally, for arduino, you can only have one library version installed at one time. Therefore, when you enable the facility to use different library versions your code might not then compile in the arduino ide (depends which version of a lib the arduino ide actually thinks is installed).
Libraries are effectively just a few .cpp and .h files. However, they do not have access to the project code. The project has access to library code not the otherway around. A library can also use code from other libraries.
I hope this helps.