Keyword arguments

Be easy, I'm very new to Arduino and it's IDE.
I know that the Arduino IDE comes with many included libraries and they seem to be well documented. I've moved on to learn how to use contributed libraries in some of my sketches. What I don't understand is where to find documentation on how to use these libraries. Many are available on github. Those (usually) include a "KEYWORDS" file that lists the keywords available to use with that library. That's fine, but nowhere have I been able to find what arguments this or that keyword requires. For instance, how would a newbie find out what arguments tft.fillRoundRect requires.

Free_Shipping:
Be easy, I'm very new to Arduino and it's IDE.
I know that the Arduino IDE comes with many included libraries and they seem to be well documented. I've moved on to learn how to use contributed libraries in some of my sketches. What I don't understand is where to find documentation on how to use these libraries. Many are available on github. Those (usually) include a "KEYWORDS" file that lists the keywords available to use with that library. That's fine, but nowhere have I been able to find what arguments this or that keyword requires. For instance, how would a newbie find out what arguments tft.fillRoundRect requires.

open up the H file and look at the function. you'll find what arguments it needs or can return.

The keywords file is just for the Arduino IDE syntax highlighter. It's a very primitive system that just searches for each of those words, and displays them in a certain color.

The header files (.h) contain the API of the library, and should contain information about the usage of functions and methods the library provides.
If you want to know the specific implementation details, you can look for the definitions of these functions in the implementation files (.cpp).

Apart from that, the libraries should contain a Wiki (on GitHub), a doc folder with documentation, or a ReadMe with a link to online documentation.

If the library doesn't have any documentation, you should open an issue, and ask the developer for clear documentation of his code.
If he's unable properly document his work, you're probably better off not using his code at all, and using a different library.

Pieter

Hi,
Most well written libraries will have equally well written and commented examples.

Tom.. :slight_smile:

I recommend against considering keywords.txt documentation. It's quite common for these files to be incomplete or to contain keywords for things that have since been removed from the library. Many libraries don't even have a keywords.txt file.

I agree. I don't like them, I even delete keyword.txt from other libraries. The problem I have with them is all keyword files are loaded, no matter if you use the library or not. So even if it's not part of the library you use if might get highlighted because it's a keyword of another library. For example, if you have (the excellent) u8g2 library installed but don't use it something like

Serial.drawDisc()

get's highlighted as if it would be valid code.

For libraries I release I generate documentation with Doxygen. Available online (GitHub) and in the "doc" folder of the library.