Hi can anyone help me find documentation which will help me understand how to use library’s. I don’t want to rely on the examples submitted with the library but to be able to decode the .h and .ccp files so that I can understand fully how to use the library.
I have been looking at the Adafruit_LEDBackpack library and although they provide many examples there is no other advise on how to use the library.
Your post was MOVED to its current location as it is more suitable.
Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
If it's not in the library itself, or in GitHub, then it's unlikely to exist, except in the authors' heads.
Usually, those libraries are fairly small. If you work through the examples to get an idea of the basic functioning and then read the library source files, you should be able to get an idea fairly swiftly of the high level functionality.
It may be a bit more tricky if there is hardware specific stuff relating to the different displays it can drive, assuming you want to dig that deep.
The .h and .cpp files are at GitHub - adafruit/Adafruit_LED_Backpack: Adafruit LED Backpack Library for our various LED backpacks.
You can find the source for most libraries with a search like "github ArduinoLibraryNameOfInterest"
I fully agree. that is a shame. if i buy a hammer no instruction is included. how should i understand how it works? yes, i have seen how other people working, but how must I understand this by myself ?
The source files for the library are also located on your computer, generally under the Arduino/libraries folder (the same Arduino folder where the sketches are stored).
Hi thanks for all your reply’s. Any thoughts about deciphering the .h and .cpp files. I don’t even understand the words used in the files so perhaps, is there some sort of glossary of the terms used in writing one of these files. There must be a starting point for learning this sort of thing.
The "words" are the C++ programming language.
Hi gfvalvo Yes but C++ is a big topic I just want to start in a tiny corner of C++ How do I find out what #define, @brief, @param, @return mean in a .h file
All the lines starting with '@' are part of comments. I'm not sure, but they could be used by some kind of automatic documentation generator like Doxygen. But, that's just speculation.
'#define' is a directive to the Pre-Processor
The @brief, @param, and @return are inside of comments and are not code. They are there to help automated documentation generation per Doxygen Manual: Documenting the code.
public:
/*!
@brief Constructor for 8x8 pixel bi-color matrices.
*/
Adafruit_BicolorMatrix(void);
/*!
@brief Lowest-level pixel drawing function required by Adafruit_GFX.
Does not have an immediate effect -- must call writeDisplay()
after any drawing operations to refresh display contents.
@param x Pixel column (horizontal).
@param y Pixel row (vertical).
@param color Pixel color (LED_OFF, LED_GREEN, LED_YELLOW or LED_RED).
*/
void drawPixel(int16_t x, int16_t y, uint16_t color);
};
Hi Thanks for all your help. I get the feeling I won’t just be able to down load a "Handy guide to libraries". To be honest I wouldn’t need to if all libraries were supported like millisDelay are with this page https://www.forward.com.au/pfod/ArduinoProgramming/TimingDelaysInArduino.html .
I am going to start with the previously mentioned Adafruit_LEDBackpack library, run through the examples and try and deconstruct the library. I am sure to learn something on the way.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.