I am trying to understand more about how Arduino Libraries work.
To be to be more specific. Knowing what code functions / commands are available when using a library.
I have been messing about with a rotary encoder trying to control a Stepper motor connected to an old radio dial cord and some of the code requires the stepper library.
So am I correct in thinking that in the Stepper library the only functions the coder can use when accessing that library are
Actually the only functions are setSpeed and step. Stepper(steps,pin1,pin2) and Stepper(steps,pin1,pins,pin3,pin4) are constructors. Constructors are used to create new objects of the class.
As I said, the definitive is to slog your way through the library's source code. You can learn some good programming techniques doing that -- and some bad ones.
If you're lucky the library's examples will provide enough guidance.
pert:
Read the documentation: Stepper - Arduino Reference
Pros: Easier to read.
Cons: May be incomplete or incorrect.
What annoys me about Arduino’s library documentation is that it rarely shows prototype-fashion declarations for the functions.
If it did, I could tell in just one glance what types of arguments (parameters?) it takes and what type it returns. There should be one such declaration documented for each flavor in the case of overloaded functions.
I actually think that the prototype style notation is confusing to beginners. I do think it's essential to always document the return type of the function and the type of each parameter. The Arduino documentation attempts to do this in a more beginner-friendly, if less concise, fashion but I think the specific format could be tweaked a little and used consistently throughout the reference pages. It's currently somewhat patchy. They are getting ready to release a complete rework of the language reference pages in a few days but I'm not sure how much improvement there will be in content and in fact there will be some regressions. However, the great thing is this will allow anyone to propose improvements by simply submitting a pull request to the reference repository.